• 100% Satisfaction Guarantee

Zabo04, Computer Enthusiast
Category: Microsoft Office
Satisfied Customers: 282
Experience:  Experienced in Word, Excel, Access, Powerpoint, and Outlook.
58597962
Type Your Microsoft Office Question Here...
Zabo04 is online now

# I am trying to use an if formula and a mod formula together.

### Customer Question

I am trying to use an if formula and a mod formula together. the if formula is
=IF(G10>0,G10-G9,L8-G9)
The Mod formula is
=mod(l8-g9,1)
I'm running into a problem computing flight time For example: In L8 I have 00:05 and in G9 I have 23:55. I want the answer to be 00:10 min.
Submitted: 1 year ago.
Category: Microsoft Office
Expert:  Zabo04 replied 1 year ago.

From what you have described you should be able to insert the mod into the if statement as follows: =IF(G10>0,MOD(G10-G9,1),MOD(L8-G9,1))

Expert:  Zabo04 replied 1 year ago.

The best way to work these problems would be to establish the if statement, like you have, so =if( condition here, cell1, cell2 ), which allows you to define your condition to go to either the value in cell1 or cell2. You already know that, and I'm not talking down to you I'm just walking you through how I work. So in cell1 I have a formula and in cell2 I have a formula. Now I often have it stretched out to a chain of cells. What I do to collapse down to one large formula is then click on the cell and copy the formula from the formula bar, without the equal sign, and paste it into the cell reference in the calling formula. I keep doing that until I'm done.

In your case start with =IF(G10>0,g12, g13), in g12 (or wherever you want) put =MOD(G10-G9,1), g13 =MOD(L8-G9,1). When you collapse you just copy and paste from g12 into where you have your formula over the g12 reference. When you build in this way you can have a very complicated formula broken into parts for development and troubleshooting.

Customer: replied 1 year ago.
I think it works.Thanks a lot!!
Expert:  Zabo04 replied 1 year ago.

No problem. Please do not forget to rate my service today. Thank you.