Identify if date and time is in the past

sharky12345

Well-known Member
Joined
Aug 5, 2010
Messages
3,404
Office Version
  1. 2016
Platform
  1. Windows
This may be a big ask, but worth asking the experts.....

I have a worksheet with dates in 1 column and times in another - I need to identify if the date and time is in the past and display text for the result.

The dates are in column C and are formatted as "dd/mm/yyyy". The times are in column D and formatted as "hh:mm".

I need the text in column I to be as follows;

1) If date and time is in the future then text to read "FUTURE"
2) If date and time is in the past but not be more than 12 hours then text to read "EXPIRING"
3) If date and time is in the past and more than 12 hours then text to read "EXPIRED"

Is this anywhere near possible guys?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
This may be a big ask, but worth asking the experts.....

I have a worksheet with dates in 1 column and times in another - I need to identify if the date and time is in the past and display text for the result.

The dates are in column C and are formatted as "dd/mm/yyyy". The times are in column D and formatted as "hh:mm".

I need the text in column I to be as follows;

1) If date and time is in the future then text to read "FUTURE"
2) If date and time is in the past but not be more than 12 hours then text to read "EXPIRING"
3) If date and time is in the past and more than 12 hours then text to read "EXPIRED"

Is this anywhere near possible guys?

Hi,
Check this formula placing in column I. I assume your data start from row 2. If not, adjust it in the formila below.

Code:
=IF(C2+D2>Now();"Future";IF(Now()-(C2+D2)<=1/24*12;"Expiring";"Expired"))
 
Upvote 0
Perfect - works a treat, (I had to replace ; with , but just a minor tweak).

Thanks!
 
Upvote 0
Thanks for the feedback. So sorry.for the mistake with ";" instead of ",". I wrote the formula on my mobile and still forget that in English excel it's used "," - I'm from Poland and in Polish excel it's used ";" instead.
However, it's good to know that I've helped you somhow to solve your issue :)
My pleasure :)
Regards,
Sebastian
 
Upvote 0

Forum statistics

Threads
1,214,430
Messages
6,119,438
Members
448,897
Latest member
dukenia71

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