adding range and subtracting from another range?

lezawang

Well-known Member
Joined
Mar 27, 2016
Messages
1,805
Office Version
  1. 2016
Platform
  1. Windows
Hi I got 300 when I tried this:

A1 = 300, A2 = 200, A3= 100

=SUM(A1:A2-(A3))

Why 300? putting A3 between () or not, wont change anything.

Second question please, how you would write a function or formula to do this ( I want to know the best practice)

Adding range A1:A3 with B1:B5 and subtract the result from C1:C4

I was thinking like this = sum(A1:A3,B1:B5) - sum(C1:C4)

Is that the best way?

Thank you very much.
 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.
Because you are summing this:

A1-A3 and A2-A3

so 200 + 100. Im not quite sure what you mean by the 2nd bit. If you need to subtract the result from the sum of C1:C4 then that needs to come first.
 
Upvote 0
If you want to subtract C1:C4 from the sum of the other cells
Excel Formula:
=SUM(A1:A3,B1:B5,-C1:C4)
or to subtract A & B from C
Excel Formula:
=SUM(-A1:A3,-B1:B5,C1:C4)
 
Upvote 0

Forum statistics

Threads
1,214,646
Messages
6,120,717
Members
448,985
Latest member
chocbudda

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