ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Nested IF statement (https://www.excelbanter.com/excel-worksheet-functions/127399-nested-if-statement.html)

PattiP

Nested IF statement
 
We have the following formula in a worksheet:

=IF(C3<C6,C3-C16,IF(C16-C6<=0,ABS(C16-C6),0))

In the second statement C3-C16, we would also like to include if C3-C16 <
0, enter a 0 in the cell. Otherwise, just calculate C3-C16.

Any help would be appreciated!

Patti



--
Patti

vezerid

Nested IF statement
 
Is this what you want?

=IF(C3<C6,MAX(C3-C16,0),IF(C16-C6<=0,ABS(C16-C6),0))

HTH
Kostis Vezerides

PattiP wrote:
We have the following formula in a worksheet:

=IF(C3<C6,C3-C16,IF(C16-C6<=0,ABS(C16-C6),0))

In the second statement "C3-C16", we would also like to include if C3-C16 <
0, enter a "0" in the cell. Otherwise, just calculate C3-C16.

Any help would be appreciated!

Patti



--
Patti



driller

Nested IF statement
 
let try getting rid of nest..
with this one
=AND(C6C3,C3=C16,C16C6)*(C3-C16)+ABS(AND(C6=C16,C16<=C3)*(C16-C6))
copy n paste..
--
*****
birds of the same feather flock together..



"PattiP" wrote:

We have the following formula in a worksheet:

=IF(C3<C6,C3-C16,IF(C16-C6<=0,ABS(C16-C6),0))

In the second statement C3-C16, we would also like to include if C3-C16 <
0, enter a 0 in the cell. Otherwise, just calculate C3-C16.

Any help would be appreciated!

Patti



--
Patti


PattiP

Nested IF statement
 
Yes! It worked great. Thank you so much. We tried several options prior to
this but couldn't get it to work. THANK YOU!
--
Patti


"vezerid" wrote:

Is this what you want?

=IF(C3<C6,MAX(C3-C16,0),IF(C16-C6<=0,ABS(C16-C6),0))

HTH
Kostis Vezerides

PattiP wrote:
We have the following formula in a worksheet:

=IF(C3<C6,C3-C16,IF(C16-C6<=0,ABS(C16-C6),0))

In the second statement "C3-C16", we would also like to include if C3-C16 <
0, enter a "0" in the cell. Otherwise, just calculate C3-C16.

Any help would be appreciated!

Patti



--
Patti




ShaneDevenshire

Nested IF statement
 
How about simplifing the modified original formula as well to read:

=IF(C3<C6,MAX(C3-C16,0),MAX(C6-C16,0))

--
Thanks,
Shane Devenshire


"driller" wrote:

let try getting rid of nest..
with this one
=AND(C6C3,C3=C16,C16C6)*(C3-C16)+ABS(AND(C6=C16,C16<=C3)*(C16-C6))
copy n paste..
--
*****
birds of the same feather flock together..



"PattiP" wrote:

We have the following formula in a worksheet:

=IF(C3<C6,C3-C16,IF(C16-C6<=0,ABS(C16-C6),0))

In the second statement C3-C16, we would also like to include if C3-C16 <
0, enter a 0 in the cell. Otherwise, just calculate C3-C16.

Any help would be appreciated!

Patti



--
Patti



All times are GMT +1. The time now is 01:50 AM.

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