if then statements

blairkropp

New Member
Joined
Feb 18, 2005
Messages
22
how do you do an if then statement in excel. I am trying to do if e19-d19 > 8 then = "oss" else if equals that amount. I am trying to subtract by using miliraty time. can you please help. thanks!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
=IF(E19-D19>8,"oss",E19-D19)

Not really sure if I understand your request. What's in E19 and D19?
 
Upvote 0
blairkropp said:
how do you do an if then statement in excel. I am trying to do if e19-d19 > 8 then = "oss" else if equals that amount. I am trying to subtract by using miliraty time. can you please help. thanks!

Excel store times as fractions of a day, so 8 hours is 1/3, so....

=IF(A2-A1 > 1/3,"oss","")

or

=IF(A2-A1>"8:00"+0,"oss","")

Yor're unclear as to what happens when the time is less than or equals
 
Upvote 0
i got it to work, but if im trying to subtract 07:00 from 18:00 (they are two separate days) i am unable to do that.
any suggestions?
 
Upvote 0
blairkropp said:
i got it to work, but if im trying to subtract 07:00 from 18:00 (they are two separate days) i am unable to do that.
any suggestions?

=IF(A2-A1+(A2 < A1) > "8:00"+0,"OSS","")

ot

=IF(A2-A1+(A2 < A1) > 1/3,"OSS","")

again, you're unclear as to what happens if the time is less than or equal to 8 hours.
 
Upvote 0

Forum statistics

Threads
1,213,544
Messages
6,114,249
Members
448,556
Latest member
peterhess2002

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