Complicated Adding Days

WolfieXL

New Member
Joined
Jan 4, 2019
Messages
9
Hello There,

I am trying to create a simple course tracking spreadsheet within Excel.

I would like to something similar to below:
NameStartFinishDaysResult
Smith10-7-2113-7-213Pass
Calvin10-7-212In Progress

Ideally I would like the Start date and number of days passed displayed under the days column. However, when a date is entered in the finish column I would like the counting to stop and display only the days between the Start and end Dates, otherwise it would display the days passed since the start date.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Try this formula:
Excel Formula:
=IF(C2>0,C2-B2,TODAY()-B2)
where C2 is the Finish Date cell, and B2 is the Start Date cell.
 
Upvote 0
Thank you Joe, that formula works amazing.

If I would like to take it one step further by only displaying the result if there is a number entry in B2, how can I get this to work?

I have tried:

=if(isnumber(B2),C2>0,C2-B2,TODAY()-B2)," ")

I think I have too many arguments in the formula to work.
 
Upvote 0
Thank you Joe, that formula works amazing.

If I would like to take it one step further by only displaying the result if there is a number entry in B2, how can I get this to work?

I have tried:

=if(isnumber(B2),C2>0,C2-B2,TODAY()-B2)," ")

I think I have too many arguments in the formula to work.
I thought the following formula would work, however it is simply displaying a false or nothing. I must be close with the formula.

=IF(ISTEXT(A2),IF(c2>0,c2-b2,TODAY()-b2), " ")
 
Upvote 0
I managed to solve it using:
Excel Formula:
=IF(ISNUMBER($b2),IF(c2>0,c2-b2,TODAY()-b2), " ")

Thank you for your help, I would not have solved this on my own.
 
Upvote 0
I managed to solve it using:
Excel Formula:
=IF(ISNUMBER($b2),IF(c2>0,c2-b2,TODAY()-b2), " ")

Thank you for your help, I would not have solved this on my own.
Looks good, though I would recommend one minor change. Note that a single space is NOT the same as blank/nothing.
So I would recommend just returning the empty string instead of a single space, i.e.
=IF(ISNUMBER($b2),IF(c2>0,c2-b2,TODAY()-b2), "")

You would not believe the number of times I have seen single spaces mess things up for people (mess up searches, counts, mathematical computations, etc).
People don't see it on the screen, so they don't know it is there, and often assume it is a blank.
 
Upvote 0
Solution

Forum statistics

Threads
1,213,561
Messages
6,114,316
Members
448,564
Latest member
ED38

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