IF to subtract multiple rows based on other cells contents

Kurtin

New Member
Joined
Jan 20, 2021
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Heya,

So I have a total amount, which is the sum of a column, but I now want to have a cell for leftover amount. I am wondering how to subtract the amounts from the total based on if another cell says yes or not.

I attempted a formula but that just resulted in a #SPILL! error, which spans the same amount of cells that is listed in the $amount column. If anyone has any other formulas that could work, or a way to fix this one it would be greatly appreciated. Thank you in advance!!

RevHappy Expenses Tracker.xlsx
DEFGH
1TOTAL $ AMOUNT$ 100.00$ AMOUNT OWED REMAINING#SPILL!
2QTYDATE OF PURCHASE$ AMOUNTPAID (YES/NO)DATE PAID
3$ 20.00 yes
4$ 20.00
5$ 20.00
6$ 20.00
7$ 20.00
EXPENSES
Cell Formulas
RangeFormula
F1F1=SUM(Table1[$ AMOUNT])
H1H1=IF(Table1[PAID (YES/NO)]="YES",F1-Table1[$ AMOUNT],"")
Cells with Conditional Formatting
CellConditionCell FormatStop If True
A3:H7Expression=$G3=""textNO
A3:H7Expression=$G3="YES"textNO
 

Some videos you may like

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Eric W

MrExcel MVP
Joined
Aug 18, 2015
Messages
10,751
Try:

Book1
DEFGH
1TOTAL $ AMOUNT100$ AMOUNT OWED REMAINING80
2QTYDATE OF PURCHASE$ AMOUNTPAID (YES/NO)DATE PAID
320yes
420
520
620
720
Sheet5
Cell Formulas
RangeFormula
F1F1=SUM(Table1[$ AMOUNT])
H1H1=F1-SUMIF(Table1[PAID (YES/NO)],"yes",Table1[$ AMOUNT])
 
Solution

Kurtin

New Member
Joined
Jan 20, 2021
Messages
17
Office Version
  1. 365
Platform
  1. Windows
Try:

Book1
DEFGH
1TOTAL $ AMOUNT100$ AMOUNT OWED REMAINING80
2QTYDATE OF PURCHASE$ AMOUNTPAID (YES/NO)DATE PAID
320yes
420
520
620
720
Sheet5
Cell Formulas
RangeFormula
F1F1=SUM(Table1[$ AMOUNT])
H1H1=F1-SUMIF(Table1[PAID (YES/NO)],"yes",Table1[$ AMOUNT])
Worked PERFECTLY thank you so much! I understand where I went wrong
 

Watch MrExcel Video

Forum statistics

Threads
1,127,501
Messages
5,625,166
Members
416,075
Latest member
TechJosh

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