If/then formula for date/time

%3CLINGO-SUB%20id%3D%22lingo-sub-2817939%22%20slang%3D%22en-US%22%3EIf%2Fthen%20formula%20for%20date%2Ftime%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2817939%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20trying%20to%20write%20a%20formula%20to%20determine%20if%20a%20date%2Ftime%20combination%20is%20before%20or%20after%202%3A00%20PM.%20The%20format%20of%20the%20data%20is%20like%20this%2C%26nbsp%3B%20%2210%2F5%2F2021%2015%3A03%22%20but%20when%20I%20click%20into%20the%20cell%20it%20shows%20%2210%2F5%2F2021%203%3A03%3A00%20PM%22.%20Everything%20I%20have%20tried%20as%20not%20worked%20as%20expected.%26nbsp%3B%20Woudl%20really%20appreciate%20some%20input%20from%20anyone.%26nbsp%3B%20thanks%20in%20advance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2817939%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
New Contributor

I am trying to write a formula to determine if a date/time combination is before or after 2:00 PM. The format of the data is like this,  "10/5/2021 15:03" but when I click into the cell it shows "10/5/2021 3:03:00 PM". Everything I have tried as not worked as expected.  Woudl really appreciate some input from anyone.  thanks in advance.

2 Replies

@collinsj75 Let's say the time/date stamp is in A1, use this:

=MOD(A1,1)>(14/24)

TRUE = after 2PM

False = before 2PM

Works perfectly! thank you!