Sorry, addled brain.
The attached sample has two columns per record, type and amount
The problem is to count the number of records where each ‘type’ is associated with a non-zero amount.
An appropriate formula, please, preferably by a method not involving a separate column for the AND bit of the function?
Thanks in advance.
![]() |
Patch reliability is unclear. Unless you have an immediate, pressing need to install a specific patch, don't do it. |
SIGN IN | Not a member? | REGISTER | PLUS MEMBERSHIP |
-
countif and AND (xl2003 sp2)
Home » Forums » AskWoody support » Productivity software by function » MS Excel and spreadsheet help » countif and AND (xl2003 sp2)
- This topic has 10 replies, 4 voices, and was last updated 19 years, 1 month ago.
AuthorTopicWSitshimathome
AskWoody LoungerMarch 29, 2006 at 10:01 pm #430908Viewing 0 reply threadsAuthorReplies-
WSHansV
AskWoody Lounger -
WSitshimathome
AskWoody Lounger -
WSHansV
AskWoody Lounger -
WSitshimathome
AskWoody LoungerMarch 29, 2006 at 10:31 pm #1007311Sorry, Hans, neither of these works for me, neither by typing as the range reference the whole column eg H:H nor the name of the whole column, which is
type
Similarly for the amount column
Here I’ve pasted from the formula bar
=SUMPRODUCT((type=1)*(amount0))It returns a #NUM error.
What’s wrong? Both columns are formatted as numbers.
-
WSHansV
AskWoody LoungerMarch 29, 2006 at 10:46 pm #1007313Array type formulas don’t work with entire columns – see Description of the limitations for working with arrays in Excel 2000, Excel 2002, and Excel 2003. You’ll have to define “finite” ranges.
-
WSAladin Akyurek
AskWoody LoungerApril 2, 2006 at 9:27 am #1007774Since you are on Excel 2003, select the data area (including the headers) and run Data|List|Create List. All formulas referring to (parts of) the list will adjust automatically to changes to it.
A tad bit faster multiconditional counting can be effected with:
=SUMPRODUCT(–($A$2:$A$22=1),1-($B$2:$B$22=0))
-
WSitshimathome
AskWoody LoungerApril 2, 2006 at 10:25 pm #1007805Aladin, please explain the en rules aka hyphens aka minus signs in your formula?
=SUMPRODUCT(–($A$2:$A$22=1),1-($B$2:$B$22=0)) ??
Concerning efficient use of resources and optimised code, commended by Steve, here’s a workbook which I think describes and illustrates the problem (aka opportunity.)
A line of code telling excel to not add a new row if the money value of that described is zero would enable a straight countif to continue to tell the truth.
Thanks in advance, yet again. -
WSitshimathome
AskWoody Lounger
-
-
-
-
WSsdckapr
AskWoody LoungerMarch 29, 2006 at 11:08 pm #1007315I have seen sluggishness issues with large arrays and many of them. This is due to large amount of calculations in each one. I imagins that SUMPRoDUCT is slightly better but will still have issues.
If the sluggish performance is noted, it might be time to write code to create your table of values. You can optimize the code to eliminate many of the multiple passes thru the data in your code so even having the code run at the worksheet change event could be faster than all those arrays…
[The concept has been discussed before (see post 315,619 for example) or even do a search on “Sluggish” and I think you will find other threads…]
Steve
-
WSitshimathome
AskWoody Lounger
-
-
Viewing 0 reply threads -

Plus Membership
Donations from Plus members keep this site going. You can identify the people who support AskWoody by the Plus badge on their avatars.
AskWoody Plus members not only get access to all of the contents of this site -- including Susan Bradley's frequently updated Patch Watch listing -- they also receive weekly AskWoody Plus Newsletters (formerly Windows Secrets Newsletter) and AskWoody Plus Alerts, emails when there are important breaking developments.
Get Plus!
Welcome to our unique respite from the madness.
It's easy to post questions about Windows 11, Windows 10, Win8.1, Win7, Surface, Office, or browse through our Forums. Post anonymously or register for greater privileges. Keep it civil, please: Decorous Lounge rules strictly enforced. Questions? Contact Customer Support.
Search Newsletters
Search Forums
View the Forum
Search for Topics
Recent Topics
-
Master Patch Listing for May 13, 2025
by
Susan Bradley
30 minutes ago -
Installer program can’t read my registry
by
Peobody
1 hour, 3 minutes ago -
How to keep Outlook (new) in off position for Windows 11
by
EspressoWillie
13 hours, 18 minutes ago -
Intel : CVE-2024-45332, CVE-2024-43420, CVE-2025-20623
by
Alex5723
11 hours, 2 minutes ago -
False error message from eMClient
by
WSSebastian42
10 hours, 56 minutes ago -
Awoke to a rebooted Mac (crashed?)
by
rebop2020
20 hours, 1 minute ago -
Office 2021 Perpetual for Mac
by
rebop2020
21 hours, 13 minutes ago -
AutoSave is for Microsoft, not for you
by
Will Fastie
5 hours, 27 minutes ago -
Difface : Reconstruction of 3D Human Facial Images from DNA Sequence
by
Alex5723
1 day ago -
Seven things we learned from WhatsApp vs. NSO Group spyware lawsuit
by
Alex5723
1 hour, 47 minutes ago -
Outdated Laptop
by
jdamkeene
1 day, 6 hours ago -
Updating Keepass2Android
by
CBFPD-Chief115
1 day, 11 hours ago -
Another big Microsoft layoff
by
Charlie
1 day, 11 hours ago -
PowerShell to detect NPU – Testers Needed
by
RetiredGeek
14 hours, 41 minutes ago -
May 2025 updates are out
by
Susan Bradley
4 hours, 19 minutes ago -
Windows 11 Insider Preview build 26200.5600 released to DEV
by
joep517
1 day, 17 hours ago -
Windows 11 Insider Preview build 26120.3964 (24H2) released to BETA
by
joep517
1 day, 17 hours ago -
Drivers suggested via Windows Update
by
Tex265
1 day, 17 hours ago -
Thunderbird release notes for 128 esr have disappeared
by
EricB
1 day, 14 hours ago -
CISA mutes own website, shifts routine cyber alerts to X, RSS, email
by
Nibbled To Death By Ducks
2 days ago -
Apple releases 18.5
by
Susan Bradley
1 day, 18 hours ago -
Fedora Linux 40 will go end of life for updates and support on 2025-05-13.
by
Alex5723
2 days, 1 hour ago -
How a new type of AI is helping police skirt facial recognition bans
by
Alex5723
2 days, 2 hours ago -
Windows 7 ISO /Windows 10 ISO
by
ECWS
10 hours, 39 minutes ago -
No HP software folders
by
fpefpe
2 days, 9 hours ago -
Which antivirus apps and VPNs are the most secure in 2025?
by
B. Livingston
1 day, 7 hours ago -
Stay connected anywhere
by
Peter Deegan
2 days, 15 hours ago -
Copilot, under the table
by
Will Fastie
17 hours, 44 minutes ago -
The Windows experience
by
Will Fastie
2 days, 21 hours ago -
A tale of two operating systems
by
Susan Bradley
1 day, 1 hour ago
Recent blog posts
Key Links
Want to Advertise in the free newsletter? How about a gift subscription in honor of a birthday? Send an email to sb@askwoody.com to ask how.
Mastodon profile for DefConPatch
Mastodon profile for AskWoody
Home • About • FAQ • Posts & Privacy • Forums • My Account
Register • Free Newsletter • Plus Membership • Gift Certificates • MS-DEFCON Alerts
Copyright ©2004-2025 by AskWoody Tech LLC. All Rights Reserved.