formula for adding and subtracting in the same cell

shaftdx

New Member
Joined
Aug 20, 2018
Messages
38
I have a column adding up all the hours owed to an employee =sum(G4:G22) I need to be able to subtract the hours we did give them which would be populated in I4:I22. how do I get that in the same cell? adding from one column but taking away from another.
 

Some videos you may like

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

alansidman

Well-known Member
Joined
Feb 26, 2007
Messages
6,141
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
If I am understanding your request correctly then

=Sum(G4:G22)-Sum(I4:I22)
 

arthurbr

Well-known Member
Joined
Dec 8, 2006
Messages
2,198
Office Version
  1. 2010
Perhaps
Excel Formula:
=sum(G4:G22)-sum(I4:I22)
 
Solution

shaftdx

New Member
Joined
Aug 20, 2018
Messages
38
Thank you so much, I knew it was something insanely simple that I was missing...like the second set of parenthesis...
 

arthurbr

Well-known Member
Joined
Dec 8, 2006
Messages
2,198
Office Version
  1. 2010
I don't mean to be rude, but how can one know that the answer is simple without knowing the answer ? 😂
 

shaftdx

New Member
Joined
Aug 20, 2018
Messages
38
I don't mean to be rude, but how can one know that the answer is simple without knowing the answer ? 😂
it was one of those deals where I was looking at the formula and you could just tell something was missing. it just did not look right.
 

Watch MrExcel Video

Forum statistics

Threads
1,126,998
Messages
5,622,096
Members
415,876
Latest member
csibonga2k17

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
Top