Sumif formula not working - Excel emergency!

DogGoneGood

New Member
Joined
Nov 29, 2010
Messages
5
I am trying to do a sumif in excel and am getting the incorrect results. As seen in the below table. I am doing a sumif to return the sum of values for particular codes that begin with the number zero. Excel is summing up the values for both codes 0E1 and 0E2 instead of treating these codes as unique. How can I resolve this? Your prompt response would be greatly appreciated.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:eek:ffice:eek:ffice" /><o:p></o:p>

Code Value Sumifformula Sumifresult
0E1 10 =SUMIF($A:$A,A1,$B:$B) 45
0E1 20 =SUMIF($A:$A,A2,$B:$B) 45
0E2 5 =SUMIF($A:$A,A3,$B:$B) 45
0E2 10 =SUMIF($A:$A,A4,$B:$B) 45
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
It looks like your calculations may be turned off. Go to Tools>Options>Calculation and turn on automatic calculations.
 
Upvote 0
I thought that could be it but I do have automatic calculation on. It looks like it is recognizing it as some kind of exponential number but I don't know how to fix it. I even tried putting a ' in front of the zeroes.
 
Upvote 0
Ahh - that could very well be the problem.

Give this a shot:

=SUMPRODUCT(--($A$1:$A$100=TEXT(A1,"@")),$B$1:$B$100)
 
Upvote 0
Hmm - do you have more data I can use to play around with formulas? Or are you able to e-mail me your spreadsheet so I can work directly with your data? (If you opt for the e-mail, shoot me a PM and i'll give you my email addy)
 
Upvote 0
The issue is as you surmised - SUMIF is incorrectly recognising your text values as some sort of exponential number.....and because excel uses only 15 significant digits it treats them all as the same number, hence incorrect results.

This is a problem with SUMIF/COUNTIF type formulas. One advantage of those formulas is text and number are treated (almost) the same so if you use

=COUNTIF(A:A,2)

that will count numeric 2s and text 2s......but the downside is that it treats any text that looks like a number as a number, like in this case or with 16 digit credit card numbers stored as text (where only the first 15 digits are recognised).

SUMPRODUCT distinguishes between text and number - which is sometimes a problem but means that here it just sees the text value "0E1" which is what you want.....
 
Upvote 0

Forum statistics

Threads
1,214,920
Messages
6,122,269
Members
449,075
Latest member
staticfluids

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top