Excel Formula help - IF statements?

Copper Contributor

Hi guys, 

 

Screen Shot 2018-09-28 at 11.50.08 AM.png

I want to differentiate these two columns. If the difference in time between "Order Date" and "Printed Date" is less than 24 hours I want the data to say "Stocked". If the difference in time is greater than 24 hours, I want it to say "Not stocked". 

Is there a formula I can build so that I don't have to go through each one individually? 

 

Thanks!

7 Replies
try:
=IF((CONVERT(L2,"day","hr")-CONVERT(K2,"day","hr"))>24,"Not stocked","Stocked")
hope this helps..

the above should do it.

sorry, the first post is only computing hours - not including the days ...

the cell where the formula will be put must be formatted to "General" NOT TIME..

Wow, thank you so much!! You've literally saved me hours

glad to help...

@Lorenzo Kim

Why would you use CONVERT()?

=IF(B2-A2>1,"Not ","")&"Stocked"

 

I computed the difference in hours between 2 dates..
since 24 hrs = 1 day - your formula is also correct...

and much shorter. NEAT!
thanks..