How can I SUMIFS with leading zeros

Dark0Prince

Active Member
Joined
Feb 17, 2016
Messages
433
Code:
=SUMIFS('GJS2'!$C:$C,'GJS2'!$A:$A,GJNETS!$A8)

I need to be able to add 0999 client separate from 999 client and it's adding them together.
Iv'e for mated it as text and tried putting the whole code in a SUMPRODUCT.
 
Last edited:

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
You have to use SUMPRODUCT instead of SUMIF:

=SUMPRODUCT('GJS2'!$C$1:$C$1000,--('GJS2'!$A$1:$A$1000=GJNETS!$A8))

adjusting the ranges as necessary. (Don't use entire column references)
 
Last edited:
Upvote 0
You have to use SUMPRODUCT instead of SUMIF:

=SUMPRODUCT('GJS2'!$C$1:$C$1000,--('GJS2'!$A$1:$A$1000=GJNETS!$A8))

adjusting the ranges as necessary. (Don't use entire column references)

That only sums the first one it finds not if it finds it multiple times.
 
Upvote 0
No, it doesn't. If you're only getting the total for one, then either you haven't adjusted the ranges to match your data, or the other data is not actually a match - e.g. it's just formatted to show a leading 0.
 
Upvote 0
No, it doesn't. If you're only getting the total for one, then either you haven't adjusted the ranges to match your data, or the other data is not actually a match - e.g. it's just formatted to show a leading 0.

You were right! thanks, I fixed the range.
 
Upvote 0

Forum statistics

Threads
1,223,896
Messages
6,175,260
Members
452,627
Latest member
KitkatToby

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