Can this SUMPRODUCT formula contain 000's

Mister H

Well-known Member
Joined
Mar 6, 2002
Messages
1,507
Hi:

I am trying to alter a formula and it is not working for me do to the fact that the numbers I am trying to sum begin with 0 (zero).

This is what I need:

=IF(SUMPRODUCT(--(DebitTrans=0055327),DebitMonies)>0,SUMPRODUCT(--(DebitTrans=0000001),DebitMonies),"")

When I paste this into Excel it changes to:

=IF(SUMPRODUCT(--(DebitTrans=55327),DebitMonies)>0,SUMPRODUCT(--(DebitTrans=1),DebitMonies),"")

Can the formula be altered to work or should I try and coeme up with a workaround? :confused:

THANKS,
Mark :)
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
You could do this

=IF(SUMPRODUCT(--(DebitTrans+0=55327),DebitMonies)>0,SUMPRODUCT(--(DebitTrans+0=1),DebitMonies),"")
 
Upvote 0
Hi,

How did you get the 0's there? A custom format or using ' ('0055327)?

If it's a custom format then you need to use the number (55327), if it's a ' (which is text) then you need to put speech marks around it in the formula ("0055237").
 
Upvote 0
Or

=IF(SUMIF(DebitTrans,55327,DebitMonies)>0,SUMIF(DebitTrans,1,DebitMonies),"")
 
Upvote 0
THANKS jonmo1 and James :biggrin:

I will give that your suggestions a try. For the record the number I am summing is acquired through this formula:

=IF(B120="","",LOOKUP(B120,DebitMerchantNo,DebitDescNo))

The DebitDescNo table is text.

Again THANKS for your assistance. I think I will change to the SUMIF instead of the SUMPRODUCT. Not really sure what the difference is but I like the looks of the SUMIF better :biggrin:

Take Care,
Mark

I just tried:

=IF(SUMIF(DebitTrans,55327,DebitMonies)>0,SUMIF(DebitTrans,1,DebitMonies),"")

and I did not get an error but it did not sum up the monies. I may have done something wrong. I will check my named ranges <!-- / message --><!-- sig -->

:beerchug:
 
Last edited:
Upvote 0
Glad to help, thanks for the feedback..

I'm not sure of the why either....
But Sumproduct doesn't treat "numbers stored as text" as real numbers
But Sumif Does

edit...

Seems only the CRITERIA part of sumif works with "numbers stored as text"
But the SUM part of sumif does not...
 
Last edited:
Upvote 0
THANKS for the info jonmo1.

In looking at the spreadsheet again I may be able to eliminate one critieria and just SUMIF when it equals 0055327.

I play around with the SUMIF formula and this will work for me:

=SUMIF(DebitTrans,55327,DebitMonies)

THANKS Again
Have a GREAT day,
Mark
 
Last edited:
Upvote 0

Forum statistics

Threads
1,224,586
Messages
6,179,728
Members
452,939
Latest member
WCrawford

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