Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 98
Default More than 7 nested IF(AND...

HELP!!!
I've got 8 nested IF(AND) staements in my formula, please help! Is there a
simpler way of doing this???

I need to return the percentage margin for the lowest selling price. Y, AQ,
AK, AE are the 4 selling prices and P is the standard cost which needs to be
used in the margin calculation. BUT if P=0 then use the old standard cost
value which is column R. This formula was fine until I had to include the IFs
for the R and P column problem.

=IF(AND($Y20,$P20,$AQ20,$AK20,$AE20),((($AQ2-$P2))/$AQ2),IF(AND($Y20,$P20,$AQ2=0,$AK20,$AE20),((( $AK2-$P2))/$AK2),IF(AND($Y20,$P20,$AQ2=0,$AK2=0,$AE20),((( $AE2-$P2))/$AE2),IF(AND($Y20,$P20,$AQ2=0,$AK2=0,$AE2=0),((( $Y2-$P2))/$Y2),IF(AND($Y20,$P2=0,$AQ20,$AK20,$AE20),((($ AQ2-$R2))/$AQ2),IF(AND($Y20,$P2=0,$AQ2=0,$AK20,$AE20),((( $AK2-$R2))/$AK2),IF(AND($Y20,$P2=0,$AQ2=0,$AK2=0,$AE20),((( $AE2-$R2))/$AE2),IF(AND($Y20,$P2=0,$AQ2=0,$AK2=0,$AE2=0),((( $Y2-$R2))/$Y2),0))))))))

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 98
Default More than 7 nested IF(AND...

I've solved this now thanks to Chip Pearsons website...

Solution: name the formulas and use 1 IF function in the cell€¦

StdCostP:
=IF(AND($Y20,$P20,$AQ20,$AK20,$AE20),((($AQ2-$P2))/$AQ2),IF(AND($Y20,$P20,$AQ2=0,$AK20,$AE20),((( $AK2-$P2))/$AK2),IF(AND($Y20,$P20,$AQ2=0,$AK2=0,$AE20),((( $AE2-$P2))/$AE2),IF(AND($Y20,$P20,$AQ2=0,$AK2=0,$AE2=0),((( $Y2-$P2))/$Y2),0))))

StdCostR:
=IF(AND($Y20,$P2=0,$AQ20,$AK20,$AE20),((($AQ2-$R2))/$AQ2),IF(AND($Y20,$P2=0,$AQ2=0,$AK20,$AE20),((( $AK2-$R2))/$AK2),IF(AND($Y20,$P2=0,$AQ2=0,$AK2=0,$AE20),((( $AE2-$R2))/$AE2),IF(AND($Y20,$P2=0,$AQ2=0,$AK2=0,$AE2=0),((( $Y2-$R2))/$Y2),0))))

And enter in the cell€¦
IF(StdCostP,StdCostP,StdCostR)



"Meltad" wrote:

HELP!!!
I've got 8 nested IF(AND) staements in my formula, please help! Is there a
simpler way of doing this???

I need to return the percentage margin for the lowest selling price. Y, AQ,
AK, AE are the 4 selling prices and P is the standard cost which needs to be
used in the margin calculation. BUT if P=0 then use the old standard cost
value which is column R. This formula was fine until I had to include the IFs
for the R and P column problem.

=IF(AND($Y20,$P20,$AQ20,$AK20,$AE20),((($AQ2-$P2))/$AQ2),IF(AND($Y20,$P20,$AQ2=0,$AK20,$AE20),((( $AK2-$P2))/$AK2),IF(AND($Y20,$P20,$AQ2=0,$AK2=0,$AE20),((( $AE2-$P2))/$AE2),IF(AND($Y20,$P20,$AQ2=0,$AK2=0,$AE2=0),((( $Y2-$P2))/$Y2),IF(AND($Y20,$P2=0,$AQ20,$AK20,$AE20),((($ AQ2-$R2))/$AQ2),IF(AND($Y20,$P2=0,$AQ2=0,$AK20,$AE20),((( $AK2-$R2))/$AK2),IF(AND($Y20,$P2=0,$AQ2=0,$AK2=0,$AE20),((( $AE2-$R2))/$AE2),IF(AND($Y20,$P2=0,$AQ2=0,$AK2=0,$AE2=0),((( $Y2-$R2))/$Y2),0))))))))

Thanks!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Possible to combine VLOOKUP and IF(AND) functions? Ihoris Excel Worksheet Functions 1 April 6th 06 09:54 AM
Nested Subtotals in Excel 2002 KG Excel Discussion (Misc queries) 2 September 10th 05 11:51 AM
nested if(and) functions Rohan Excel Discussion (Misc queries) 3 August 12th 05 01:30 AM
Why are my nested sub-totals are displaying incorrectly? chiefdean13 Excel Discussion (Misc queries) 1 July 20th 05 05:45 AM
Nested IF(AND is not working Todd F. Excel Worksheet Functions 13 June 24th 05 10:20 PM


All times are GMT +1. The time now is 01:45 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"