-
WSAladin Akyurek
AskWoody LoungerYour sample data is in A1:E5 including the labels.
{0,”Jan”,”Feb”,”Mar”,”prices”;
“Green”,”a”,”b”,”d”,26;
“Blue”,”v”,”c”,0,25;
“Brown”,”c”,”a”,”d”,150;
0,0,0,”d”,260}where a 0 indicates an empty cell.
In B6 enter: =SUMPRODUCT((LEN(B2:B5)>0)+0,prices) [ where ‘prices” is the name of the range E2:E5]
Copy this formula across as far as needed.
-
WSAladin Akyurek
AskWoody LoungerLets say that ImportData starts in A10 (the cell of the first numeric entry, thus not the cell of the label), use:
=DSUM(OFFSET(A10,0,0,MATCH(9.99999999999999E+307,A:A),1),$A$7,I10:J11)
-
WSAladin Akyurek
AskWoody LoungerThe rule of applying COUNTIF when we have a between condition may appear confusing. It just requires some exercise. As I tried to state in my first reply, a multiconditional count or sum is ordinarily computed by means of an array formula or a SUMPRODUCT formula that is capable of operating on arrays (By the way, PivotTables etc can also be used). As a side note, array formulas are more generic than the SUMPRODUCT formulas. The former requires the key combination control+shift+enter, while the latter is entered as an ordinary formula.
COUNTIF and SUMIF, by design, cannot work with more than one condition/criteria. With a “between” condition (which boils down to multiple conditions), COUNTIF can still be used for counting (and SUMIF for summing/totaling).
Now back to your question.
Ambiguity of between (as Legare also noted):
Lets say that E1 houses the lowest and E2 the highest of criteria.
What do we mean when we say “between E1 and E2″? It can be one of the following:
> E1 and = E1 and E1 and = E1 and =”&E1)-COUNTIF(A:A,”>”&E2)
Note. Column A should not have anything else (any other numbers) but the numbers of interest that we want count.
How this formula works?
The first COUNTIF counts every cell in A that is greater than or equal to the value in E1. The second COUNTIF counts every cell in A that is greater than the value in E2. The latter count is then subtracted from the former count, producing the desired result.
The array and SUMPRODUCT versions are — these formulas by design won’t accept whole columns as range specifiers, so exact ranges must be provided:
{=SUM((A1:A34>=E1)*(A1:A34=E1)*(A1:A34<=E2)) [ normally entered ]
Aladin
-
WSAladin Akyurek
AskWoody LoungerLets say that column A houses the numbers of interest, E1 the lowest criterion (your .75), and E2 the highest criterion (your 1).
=COUNTIF(A:A,”>”&E1)-COUNTIF(A:A,”>=”&E2)
will give you a count of numbers in A which are > .75 and < 1, thus excluding the numbers that are equal to the criteria. A bit tweaking will allow you to modify the formula for counting that is based on a different form of between.
This formula is "cheaper" than an equivalent array or SUMPRODUCT formula which are definitely needed when you want a multiconditional count or sum.
Aladin
-
WSAladin Akyurek
AskWoody LoungerJohn —
I think there are 2 possible readings of what the original poster wanted:
One reading implicates
(a) ORing and another
(ANDing.
I’m sure Jan Karel was also aware of this. He simply opted for reading (a).
In array or sumproduct formulas + does the ORing, * the ANDing. Your first attempt was altogether a different thing (which prompted my reply). Fred gave an array formula with IFs, equivalent to Jan Karel’s which is constructed with Boolean terms. If the latter reading would be what the OP wants, then
{=SUM((A1:A20<0)*(B1:B20<0))
would be indeed the answer.
By the way, these two formulas have the following, normally entered, equivalents with sumproduct:
=SUMPRODUCT((((A1:A10<0)+(B1:B100)+0)
=SUMPRODUCT((A1:A20<0)*(B1:B20<0))
Regards,
Aladin
-
WSAladin Akyurek
AskWoody LoungerMike —
Try:
=SUMIF(SALESRECORD!C25:C40,TEXT(B3,”00000″),SALESRECORD!D25:D40)
the result of which proves that SALESRECORD!C25:C40 is text-formatted.
PS. Enter, say, in G1 in the worksheet SALESRECORD
=ISNUMBER(C25)
It gives 0, meaning FALSE. Why is it that I get 0 or 1 with this function in this ws instead of FALSE or TRUE?
Aladin
-
WSAladin Akyurek
AskWoody LoungerI don’t think your version
{=SUM(((D5:D14+E5:E14)<0)*1)}
does work the same as thart of Jan Karel, which is:
{=SUM((((A1:A10<0)+(B1:B100)*1)}
Their logical structure is different,
Try both on the following sample:
{-1,1;
1,1;
-2,-4;
-4,3;
-3,4}Aladin
-
WSAladin Akyurek
AskWoody LoungerGiven the structure of your examples,
{“ABC1234567”;
“AB12345678”;
“ABC12 34 567″}which, say, A1:A3 houses,
in B1 enter: =SUBSTITUTE(A1,RIGHT(A1,SUMPRODUCT((LEN(A1)-LEN(SUBSTITUTE(A1,{” “,0,1,2,3,4,5,6,7,8,9},””))))),””)
in C1 enter: =SUBSTITUTE(A1,B1,””) or, depending on what you’d prefer, =SUBSTITUTE(SUBSTITUTE(A1,B1,””),” “,””)+0
Select B1:C1 and copy down.
-
WSAladin Akyurek
AskWoody LoungerJanuary 13, 2002 at 9:18 am in reply to: Showing Days of the Week in Date Format (Excel 2000) #563460Custom format the date cells as
dddd, mmmm dd, yyyy
-
WSAladin Akyurek
AskWoody LoungerThe question involves totaling amounts involving a criterion month.
Lets say that A2:A100 houses full date entries and B2:B100 dollar amounts.
In order to use the SUMIF effectively, which is an appropriate function for the task, you need the following:
In C2 enter: =MONTH(A2) [or =TEXT(A2,”MMM”) ]
Copy down this formula till C100.
In D2 enter: a month number of interest if column C created with =MONTH(..) or a 3-letter month name if column C is created with =TEXT(…,”MMM”),
In E2 enter: =SUMIF($C$2:$C$100,D2,$B$2:$B$100)
Another method, where you don’t need to create column C, would be with SUMPRODUCT.
If D2 is a month number (the criterion month),
in E2 enter: =SUMPRODUCT((MONTH($A$2:$A$200)=D2)*($B$2:$B$100))
Or, if D2 is a 3-letter month name (the criterion month),
in E2 enter: =SUMPRODUCT((TEXT($A$2:$A$200,”MMM”)=D2)*($B$2:$B$100))
The first method (with SUMIF) should be preferred above the second if the actual data range consists of more than 1000 rows.
-
WSAladin Akyurek
AskWoody LoungerJohn —
A more effiecient formula for the task would be:
=COUNTIF(Countries,M2)>0
where Countries names a range in a column (or in a row for that matters).
By the way, MATCH is not a bad choice as you seem to think. I’d rather prefer it to VLOOKUP in this case (for esthetical reasons):
So:
=ISNUMBER(MATCH(M2,Countries,0)
would do just as well.
Note. Both formulas intendedly return a logical value, either TRUE or FALSE.
![]() |
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 |

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
-
Non Apple Keyboards
by
pmcjr6142
3 hours, 4 minutes ago -
How to delete your 23andMe data – The Verge
by
AJNorth
30 minutes ago -
7 common myths about Windows 11 (Microsoft AD)
by
EyesOnWindows
2 hours, 40 minutes ago -
Error updating to Win11 0x8024a205
by
bmeacham
2 hours, 32 minutes ago -
default apps
by
chasfinn
2 hours, 14 minutes ago -
Will MS Works 4 work in MS Win 11?
by
MileHighFlyer
10 hours, 9 minutes ago -
Adding links to text in Word 2000
by
sgeneris
2 hours, 10 minutes ago -
FBI warnings are true—fake file converters do push malware
by
Nibbled To Death By Ducks
3 hours, 47 minutes ago -
Classic and Extended Control Panel — no need to say goodbye
by
Deanna McElveen
25 minutes ago -
Things you can do in 2025 that you couldn’t do in 2024
by
Max Stul Oppenheimer
14 hours, 55 minutes ago -
Revisiting Windows 11’s File Explorer
by
Will Fastie
4 hours ago -
Planning ahead for migration
by
Susan Bradley
4 hours, 39 minutes ago -
Yahoo mail getting ornery
by
Tom in Az
2 hours, 22 minutes ago -
Is Spectrum discontinuing email service?
by
Peobody
5 hours, 54 minutes ago -
Practice what you preach! A cautionary tale.
by
RetiredGeek
2 hours, 26 minutes ago -
Looking for Microsoft Defender Manuals/Tutorial
by
blueboy714
6 hours, 38 minutes ago -
Win 11 24H2 Home or Pro?
by
CWBillow
3 hours, 9 minutes ago -
Bipartisan Effort to Sunset the ‘26 Words That Created the Internet’..
by
Alex5723
2 days, 12 hours ago -
Outlook new and edge do not load
by
cHJARLES a pECKHAM
3 days ago -
Problem using exfat drives for backup
by
Danmc
3 days, 1 hour ago -
I hate that AI is on every computer we have!
by
1bumthumb
2 days, 3 hours ago -
Change Info in the Settings window
by
CWBillow
3 days, 7 hours ago -
Attestation readiness verifier for TPM reliability
by
Alex5723
3 days, 14 hours ago -
Windows Update says that “some settings are managed b your organization”
by
Ed Willers
3 days ago -
Use of Gmail rejected.
by
CBFPD-Chief115
3 days ago -
WuMgr operational questions
by
Tex265
1 hour, 58 minutes ago -
Beijing’s unprecedented half-marathon: Humans vs. humanoids!
by
Alex5723
4 days, 5 hours ago -
New Phishing Campaign Targeted at Mac Users
by
Alex5723
3 days, 6 hours ago -
Backing up Google Calendar
by
CWBillow
4 days, 12 hours ago -
Windows 11 Insider Preview build 27818 released to Canary
by
joep517
5 days ago
Recent blog posts
- Classic and Extended Control Panel — no need to say goodbye
- Things you can do in 2025 that you couldn’t do in 2024
- Revisiting Windows 11’s File Explorer
- Planning ahead for migration
- Woody Leonhard (1951–2025)
- What I learned from Woody Leonhard
- Windows Settings today
- Mail Merge magic in Microsoft Word
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.