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: 54

Excel Facts

How to create a cell-sized chart?
Tiny charts, called Sparklines, were added to Excel 2010. Look for Sparklines on the Insert tab.
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,214,644
Messages
6,120,709
Members
448,983
Latest member
Joaquim_Baptista

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