Subtracting if drop down box says "Yes"

niccc

New Member
Joined
Feb 4, 2022
Messages
5
Office Version
  1. 2021
Platform
  1. Windows
Hi all,

I would like some help with an excel spreadsheet I am creating to keep track of my overtime at work.

As seen in the attached file, Column D is the overtime that I worked on that day. Column E is a dropdown box (Yes,No) which identifies if I have used those overtime hours (Eg. On X day, I decided to finish work early and use my overtime hours from the previous day. In this instance, I would be selecting "Yes").

Cell D7 is equal to the total amount of overtime worked. I currently have =SUM(D3:D5) as the formula.

Cell D8 would be the actual total. Basically subtracting any overtime hours used.

I would like to know what formula I can use so that every time a cell in column E says "Yes", it would subtract the total amount of overtime in cell D7 and create a new value in D8 (actual total).

I tried to use the formula =IF(E3="Yes",D7-D3,D7) in cell D8, however, it only works for that specific row and not the ones below/after.

Thank you :)
 

Attachments

  • spreadsheet.JPG
    spreadsheet.JPG
    33.1 KB · Views: 89

Excel Facts

Copy formula down without changing references
If you have =SUM(F2:F49) in F50; type Alt+' in F51 to copy =SUM(F2:F49) to F51, leaving the formula in edit mode. Change SUM to COUNT.
Hi,

Incorporate SUMIF:

Book3.xlsx
ABCDE
1
2
32No
410Yes
52Yes
6
714
82
Sheet990
Cell Formulas
RangeFormula
D7D7=SUM(D3:D5)
D8D8=D7-SUMIF(E3:E5,"Yes",D3:D5)
 
Upvote 0
Solution
You're welcome, thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,224,746
Messages
6,180,705
Members
452,994
Latest member
Janick

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