IF DATE and TIME

AtTcQ

New Member
Joined
Jan 10, 2020
Messages
15
Office Version
2019
Platform
Windows
I currently use this to check if date has passed but i also need to set a time on it too. Is it possible?

VBA Code:
=IF(B:B>TODAY(),"Not Passed","Passed")
 

Some videos you may like

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.

juddaaaa

Board Regular
Joined
Jan 4, 2020
Messages
208
Office Version
365
Platform
Windows
Try this

Cell A1: 10/01/2020 23:30:00
VBA Code:
=IF(VALUE(A1)>VALUE(NOW()), "Not passed", "Passed")
 

AtTcQ

New Member
Joined
Jan 10, 2020
Messages
15
Office Version
2019
Platform
Windows
Try this

Cell A1: 10/01/2020 23:30:00
VBA Code:
=IF(VALUE(A1)>VALUE(NOW()), "Not passed", "Passed")
Sorry i forgot to mention i want to add a specific time not the current time e.g 23:00
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,890
Office Version
365, 2010
Platform
Windows, Mobile
One way...

Book1
ABC
104/12/2020 14:41:00Not passed
204/12/2020 14:39:00Passed
Sheet3
Cell Formulas
RangeFormula
C1:C2C1=IF(A1>=(DATEVALUE("04/12/2020")+TIMEVALUE("14:40")), "Not passed", "Passed")
 

AtTcQ

New Member
Joined
Jan 10, 2020
Messages
15
Office Version
2019
Platform
Windows
Can i still use the TODAY function without actually putting a date in?

Tried this but its saying "Passed"
=IF(D:D>TODAY()+TIMEVALUE("22:00"),"Not passed", "Passed" )
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,890
Office Version
365, 2010
Platform
Windows, Mobile
Can i still use the TODAY function without actually putting a date in?
You can't use it for an entire column like that, best describe exactly what you are trying to achieve.
 

AtTcQ

New Member
Joined
Jan 10, 2020
Messages
15
Office Version
2019
Platform
Windows
Even when i set it to the selected column it still doesnt work
 

MARK858

MrExcel MVP
Joined
Nov 12, 2010
Messages
12,890
Office Version
365, 2010
Platform
Windows, Mobile
I meant row*
Post a sample of your data using the board XL2BB app and describe exactly what you are trying to do.
Post number 4 was directly from the worksheet and as I stated you can't apply it to an entire column which is what D:D is.
 

Watch MrExcel Video

Forum statistics

Threads
1,102,593
Messages
5,487,749
Members
407,609
Latest member
Chrissie1970

This Week's Hot Topics

  • Timer in VBA - Stop, Start, Pause and Reset
    [CODE=vba][/CODE] Option Explicit Dim CmdStop As Boolean Dim Paused As Boolean Dim Start Dim TimerValue As Date Dim pausedTime As Date Sub...
  • how to updates multiple rows in muliselect listbox
    Hello everyone. I need help with below code. code is only chaning 1st row in mulitiselect list box. i know issue with code...
  • Delete Row from Table
    I am trying to delete a row from a table using VBA using a named range to find what I need to delete. My Range is finding the right cell. In the...
  • Assigning to a variable
    I have a for each block where I want to assign the value in column 5 of the found row to the variable Serv. [CODE=vba] For Each ws In...
  • Way to verify information
    Hi All, I don't know what to call this formula, and therefore can't search. I have a spreadsheet with information I want to reference...
  • Active Cell Address – Inactive Sheet
    How to use VBA to get the cell address of the active cell in an inactive worksheet and then place that cell address in a location on the current...
Top