how to extend sumproduct formula beyond the current range

Gerti Ballia

New Member
Joined
Jun 15, 2017
Messages
4
Hello All,

I am using the sumproduct to sumif when the first number is 1 or 2. in column A I have the list of the accounts which are 7 digit number and in the column B, I have the amount. The formula is SUMPRODUCT(--(VALUE(LEFT(A4:A60,1))=1)+(VALUE(LEFT(A4:A60,1))=2),(B4:B60)). It works fine, but the issue is that I need to use the same formula for different range when pasting different set of data. When I try to extend the range of data and changing the formula in SUMPRODUCT(--(VALUE(LEFT(A4:A600,1))=1)+(VALUE(LEFT(A4:A600,1))=2),(B4:B600)), then I get #VALUE!. I want the formula to work whenever I paste different set of data , like 20 or 200 rows in the column A and B.

Thank you!
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
Perhaps one or more of the entries in column A of the larger data set is not a a number greater than or equal to zero. That will cause your extended formula to return #VALUE!.
 
Upvote 0
Hello, thanks for the replying. The photo shows how my data is. After row 60, all I have is blank.
Perhaps one or more of the entries in column A of the larger data set is not a a number greater than or equal to zero. That will cause your extended formula to return #VALUE!.
 

Attachments

  • sumproduct.PNG
    sumproduct.PNG
    40.3 KB · Views: 24
Upvote 0
Hello, thanks for the replying. The photo shows how my data is. After row 60, all I have is blank.
Well, a blank cell is not a a number greater than or equal to zero. So, that's causing the #VALUE! error. How about trying this:
Excel Formula:
=SUM(IF((A4:A600>=0)*((A4:A600=1)+(A4:A600=2)),B4:B600,0))
Depending on what version of Excel you are using, you may have to confirm this formula using ctrl+shift+enter.
This formula will not return an error if you have one or more col A entries in range A4:A600 that are blank.
 
Upvote 0

Forum statistics

Threads
1,223,248
Messages
6,171,027
Members
452,374
Latest member
keccles

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