# formula for adding and subtracting in the same cell

#### shaftdx

##### New Member
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.

### Excel Facts

Workdays for a market open Mon, Wed, Friday?
Yes! Use "0101011" for the weekend argument in NETWORKDAYS.INTL or WORKDAY.INTL. The 7 digits start on Monday. 1 means it is a weekend.

#### alansidman

##### Well-known Member
If I am understanding your request correctly then

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

#### arthurbr

##### Well-known Member
Perhaps
Excel Formula:
``=sum(G4:G22)-sum(I4:I22)``

#### shaftdx

##### New Member
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
I don't mean to be rude, but how can one know that the answer is simple without knowing the answer ?

#### shaftdx

##### New Member
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.

Replies
3
Views
201
Replies
1
Views
98
Replies
15
Views
242
Replies
3
Views
59
Replies
12
Views
414

1,127,141
Messages
5,622,969
Members
415,943
Latest member
JakeG

### 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.

### Which adblocker are you using?

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

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