If and Subtraction

AndrewD04

New Member
Joined
Aug 24, 2017
Messages
40
Office Version
  1. 365
Good Morning,

I am looking to create a little table which basically has 3 cells of numbers below what i want to be able to do is is if any cell in column G:G has a 1 in it the formula takes the i2 number and subtracts the number in column D:D where it found the 1.

So for example there is a 1 in G2 so the formula would take 2201 and subtract the corresponding number in D2 and so on if the 1 was in G4 if would take the corresponding number in D4 however i would also like it to be able to see if there is a 1 in G2 and G3 and G4 it knows to take I2 and subtract all the corresponding numbers in the Column D2 etc can this be done if so appreciate any help

Hijk
1​
2201​
=IF(G:G=1,I2-D:D)
2​
445​
3​
1452​
18.3​
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
I suggest that you update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
How about
Excel Formula:
=I2-SUMIFS(D:D,G:G,1)
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,581
Members
449,089
Latest member
Motoracer88

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