SumProduct Formula with subtraction function

chad13

Board Regular
Joined
Oct 14, 2002
Messages
105
In column A I have hourly rates and in column B I have hours. At the bottom of the column, I have a sumproduct formula: =sumproduct(a1:a10,b1:b10)
In one formula, can I maintain the sumproduct formula but add a function subtract a value, say $5.00, from every value in column A? I can't add another column so I'm trying to do it all in one formula.

Ex.
A B
$25.00 10
$22.00 12
$26.00 10

=sumproduct results in $774

I want the formula to take $5.00 from every value in column A then do the sumproduct formula. The result would be: $614.

I can do another sumproduct formula of the $5 by the hours and subtract that result from the first result but would like to see if there is another way to do it.

Any help would be greatly appreciated.

Thanks,

Chad
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Fantastic! I'm not sure how I missed this simple solution. Exactly what I was looking for. Thanks.
 
Upvote 0
This works perfectly for columns with no text. But I periodically have text items in various rows of the columns. How can I do the same formula so that it doesn't error out if there are text values.

Thanks.
 
Upvote 0
This is one way:


Excel 2010
AB
1
22510
3j12
42610
5
6410
Sheet4
Cell Formulas
RangeFormula
B6{=SUM(IF(ISNUMBER(A2:A4),A2:A4-5)*B2:B4)}
Press CTRL+SHIFT+ENTER to enter array formulas.


=SUM(IFERROR(A2:A4-5,0)*B2:B4) works too
 
Last edited:
Upvote 0
This works perfectly for columns with no text. But I periodically have text items in various rows of the columns. How can I do the same formula so that it doesn't error out if there are text values.

Thanks.

Control+shift+enter, not just enter:

=SUM(IF(ISNUMBER(A2:A4),A2:A4-5)*IF(ISNUMBER(B2:B4),B2:B4))
 
Upvote 0
This works perfectly for columns with no text. But I periodically have text items in various rows of the columns. How can I do the same formula so that it doesn't error out if there are text values.

Thanks.

Hi!

Another way (Array Formula):

Use Ctrl+Shift+Enter to enter the formula

=SUM(IFERROR((A1:A6-5)*B1:B6,0))

Markmzz
 
Upvote 0

Forum statistics

Threads
1,223,952
Messages
6,175,596
Members
452,657
Latest member
giadungthienduyen

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