Differences in two date sets calculated in one cell

Stef9910

Board Regular
Joined
Nov 2, 2022
Messages
72
Office Version
  1. 2010
Platform
  1. Windows
Hello all,

Hopefully this mini sheet will work!!

Ok, so I am try to get H2 to display the span if F2 had a date it and D2 and E2 did not
So H2 is to display E2-C2 or if they are empty, display F2-C2
If H2 displays F2-C2, I would like G2 and I2 to display 0

Any help would be greatly appreciated,

Thank you

Stefan


Differnces between dates.xlsx
ABCDEFGHIJK
1receivedstartEndRTP Days Until StartedSpantime taken
223-Mar-232-Apr-2316-Apr-23102414
3
4
5I am try to get H2 to display the span if F2 had a date it and D2 and E2 did not
6So H2 is to display E2-C2 or if they are empty, display F2-C2
7If H2 displays F2-C2, I would like G2 and I2 to display 0
8
Sheet1
Cell Formulas
RangeFormula
G2G2=SUM(D2-C2)
H2H2=SUM(E2-C2)
I2I2=SUM(E2-D2)
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
How about
Fluff.xlsm
ABCDEFGHI
1receivedstartEndRTP Days Until StartedSpantime taken
223/03/202302/04/202316/04/2023102414
Main
Cell Formulas
RangeFormula
G2G2=IF(F2="",D2-C2,0)
H2H2=IF(F2<>"",F2,E2)-C2
I2I2=IF(F2="",E2-D2,0)
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,964
Members
452,371
Latest member
Frana

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