Date and Time formula

QuizToon

New Member
Joined
Jan 31, 2009
Messages
28
Hi all,

Hope you can help me, i have been trying to find the answer but just cant seem to find it.

I have a column of cells and each contains a date and a time.

There are 2 options for what i want to display.
1. Highlight a cell in green if it has a date and time in the future of the current date and time, and red if the date and time has passed.
2. in the cell to the right it could say ongoing if the time is in the future and outstanding if the date and time has passed. I can use conditional formatting to colour the cells accordingly.

I can get the both ways to work when it is just the date but nothing happens when i include the time in the cell.

I am not clued up on VB

Hope this is a simple fix for someone.

Many Thanks
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
Hi,

I don't see why it won't work...
BTW, what's supposed to happen if the Date in the Column is same as Today?


Book1
AB
11/1/2018 14:30Outstanding
25/15/2018 11:30Ongoing
Sheet45
Cell Formulas
RangeFormula
B1=IF(A1>TODAY(),"Ongoing","Outstanding")
 
Upvote 0
Use conditional formatting, for the value to compare against, use =NOW()
You'll need two conditions. One for the before, one for future date/times.
 
Upvote 0
=IF(A1>TODAY(),"Ongoing","Outstanding")

Today() returns the current date, but with 00:00 AM for the time.

If you want it to be accurate to the minute, I'd recommend the "Now()" function.

Both of these functions are considered volatile and will only update when something elsewhere in the workbook calculates.

Basically, this means you have to force it to update by doing something :p (or hitting F9 - Thanks #5 )

Edit: As far as 'seeing' the date and time together - Format the cells with a custom format like so (dd/mm/yyyy hh:mm)
 
Last edited:
Upvote 0
Today() returns the current date, but with 00:00 AM for the time.

If you want it to be accurate to the minute, I'd recommend the "Now()" function.

Both of these functions are considered volatile and will only update when something elsewhere in the workbook calculates.

Basically, this means you have to force it to update by doing something :p (or hitting F9 - Thanks #5 )

Edit: As far as 'seeing' the date and time together - Format the cells with a custom format like so (dd/mm/yyyy hh:mm)


That did it - seems using NOW was the issue with the time part.

Thanks again
 
Upvote 0

Forum statistics

Threads
1,215,327
Messages
6,124,280
Members
449,149
Latest member
mwdbActuary

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