Calculating elapsed time using two conditions

Jazz Jones

New Member
Joined
Mar 13, 2017
Messages
13
Office Version
  1. 365
Platform
  1. Windows
Hi,

I'm looking to calculate "Weeks Active" for vacancies that are advertising. I have "Date Opened" in Column P, "Date Closed" in Column Q and today's date in Column R.

If the closing date is populated, I want Column S to calculate time elapsed between Col P and Col Q. If the vacancy is still open, I want it to calculate between Col P and Col R.

I've tried to use the ISBLANK rule but I'm getting myself in a muddle with the whole concept. Would someone be able to steer me in the right direction, please? It's killing me!

Many thanks

Jasmine
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Code:
=IF(Q2="",R2-P2,Q2-P2)

This will give you the value in Days. Enter the code in S2 and copy down
 
Upvote 0
This?


Book1
PQRS
1Date OpenedDate ClosedTodayWeeks Active
201/03/201713/03/20171
301/01/201713/03/201710
401/01/201701/02/201713/03/20174
Sheet1
Cell Formulas
RangeFormula
R2=TODAY()
S2=IF($Q2="",INT(($R2-$P2)/7),INT(($Q2-$P2)/7))


WBD
 
Upvote 0
These are both better than the way I finally managed it:
=IF(ISBLANK([@[Closing Date]]),([@Today]-[@[Date added]]),([@[Closing Date]]-[@[Date added]]))

Thank you - I will update so that it looks less messy! VERY much appreciated, guys.
 
Upvote 0

Forum statistics

Threads
1,216,028
Messages
6,128,393
Members
449,446
Latest member
CodeCybear

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