ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Combining functions: Subtraction and IF (https://www.excelbanter.com/excel-worksheet-functions/202932-combining-functions-subtraction-if.html)

Jeguth1s

Combining functions: Subtraction and IF
 
I am trying to combine 2 functions. I need the formula to first calculate this:
=C3-K3.
Based on the value returned i need to combine it with the formula below.
=IF((E3< 0),"On Time")

I want it to return "On Time" if the value of the first subtraction yields 0.
if the returned vale is 0, I need it to return the diff of the original
subtraction.
Thanks

T. Valko

Combining functions: Subtraction and IF
 
If the values you're dealing with are *always* positive then the only way to
get 0 when subtracting C3-K3 is if both cells are equal.

If that's the case:

=IF(C3=K3,"On Time",C3-K3)

Here's a generic version that accounts for not having defined what to do if
C3-K3 <0:

=IF(C3-K3=0,"On Time",IF(C3-K30,C3-K3,""))

Neither formula accounts for having empty cells.

--
Biff
Microsoft Excel MVP


"Jeguth1s" wrote in message
...
I am trying to combine 2 functions. I need the formula to first calculate
this:
=C3-K3.
Based on the value returned i need to combine it with the formula below.
=IF((E3< 0),"On Time")

I want it to return "On Time" if the value of the first subtraction yields
0.
if the returned vale is 0, I need it to return the diff of the original
subtraction.
Thanks





All times are GMT +1. The time now is 12:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com