View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Toppers Toppers is offline
external usenet poster
 
Posts: 4,339
Default how do i use contains in an if statement

this ?

=IF(ROUND(MOD(A1,1),7)=ROUND(TIME(7,0,0),7),"1st", IF(ROUND(MOD(A1,1),7)=ROUND(TIME(15,0,0),7),"2nd", "3rd"))

"Pondering" wrote:

I have data that exports in this format
4/30/2007 07:00:00
4/30/2007 15:00:00
4/30/2007 23:00:00
I'm not sure if it matters but if you actually click on the cell it also
shows AM or PM. I need an If then statement that will tell me if ex
IF A1 contains 07:00:00 then "1ST", If A1 contains 15:00:00 then "2ND",else
"3rd"

I can't get the formats right, thanks for your help!