SUMIF Criteria

B

bbrd

Is there a character limitation on the criteria value on a sumif?
The criteria I am using is 20 characters long and is returning invalid
values.


Thanks
 
P

Pete_UK

Perhaps you have both upper and lower case letters that you think are
not the same but SUMIF (and COUNTIF) do not make this distinction.

Hope this helps,

Pete
 
B

bbrd

My function looks like this

sumif(range1,"12345678901234567890",range2) .

I trimmed the criteria to 16 characters and it pulled the correct
data. With 20 characters it summed all values that had the same first
15 characters in the criteria.

Neil
 
P

Pete_UK

Excel only has 15-digit accuracy in numbers - any numbers larger than
this have the lower-order numbers truncated to zeros, so you will get
matches in formulae where you might not expect them.

Hope this helps.

Pete
 
H

Harlan Grove

bbrd said:
My function looks like this

sumif(range1,"12345678901234567890",range2) .

I trimmed the criteria to 16 characters and it pulled the correct
data. With 20 characters it summed all values that had the same first
15 characters in the criteria.

If your range1 values are text, use

=SUMPRODUCT(--(range1="12345678901234567890"),range2)

If your range1 values are numeric, they're not stored with 20 decimal
digits precision, only 15. SUMIF criteria that looks numeric is
interpretted as numeric, so your formula above compares truncated or
rounded numbers in range1 to 123456789012346*10^5. If you meant for
your range1 to hold distinct numeric values that may have differed
only in the last 5 decimal digits, your data is corrupted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top