ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Conditional functions (https://www.excelbanter.com/excel-worksheet-functions/78358-conditional-functions.html)

Andy C

Conditional functions
 
=IF(K7=1,
IF(AND(A7=51),M7/1000*$N$2,M7/1000*$O$2),
IF(AND(A7=52),M7/1000*$N$3,M7/1000*$O$3),
IF(AND(A7=53),M7/1000*$N$4,M7/1000*$O$4),
IF(AND(A7=54),M7/1000*$N$5,M7/1000*$O$5))

I have two primary conditions, either a one or two and four secondary
conditions, either 51, 52, 53, or 54. So if K7 = 1 and A7 = 51 divide
M7/1000 and multiply by O2. Evidently I have too many iterations for this
to work. Is there another way to accomplish this? I am using Office 2000
and 2003.
Thanks,

Ron Rosenfeld

Conditional functions
 
On Sun, 19 Mar 2006 19:16:27 -0800, Andy C <Andy
wrote:

=IF(K7=1,
IF(AND(A7=51),M7/1000*$N$2,M7/1000*$O$2),
IF(AND(A7=52),M7/1000*$N$3,M7/1000*$O$3),
IF(AND(A7=53),M7/1000*$N$4,M7/1000*$O$4),
IF(AND(A7=54),M7/1000*$N$5,M7/1000*$O$5))

I have two primary conditions, either a one or two and four secondary
conditions, either 51, 52, 53, or 54. So if K7 = 1 and A7 = 51 divide
M7/1000 and multiply by O2. Evidently I have too many iterations for this
to work. Is there another way to accomplish this? I am using Office 2000
and 2003.
Thanks,


You may have too many conditions, but your syntax is also incorrect.

=IF(K7=1,
IF(A7=51,M7/1000*O2,
IF(A7=52,M7/1000*O3,
IF(A7=53,M7/1000*O4,
IF(A7=54,M7/1000*O5)))),
IF(K7=2,
IF(A7=51,M7/1000*N2,
IF(A7=52,M7/1000*N3,
IF(A7=53,M7/1000*N4,
IF(A7=54,M7/1000*N5))))))

Not sure what you want to do if K7 is not 1 or 2 and/or A7 not 51-54, but you
may be able to adapt the above (which gives a FALSE result if your entries are
out of range).


--ron

Max

Conditional functions
 
One way ...

Put in M2:M5 the numbers: 51, 52, 53, 54

Then we could use:

=IF(K7=1,IF(ISNA(MATCH(A7,$M$2:$M$5,0)),M7/1000*VLOOKUP(A7,$M$2:$O$5,3,0),M7
/1000*VLOOKUP(A7,$M$2:$O$5,2,0)),"")

Have presumed that nothing, i.e. blanks: ""
to be returned if K7 <1 (this is not specified by you)

Adapt to suit
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Andy C" <Andy wrote in message
...
=IF(K7=1,
IF(AND(A7=51),M7/1000*$N$2,M7/1000*$O$2),
IF(AND(A7=52),M7/1000*$N$3,M7/1000*$O$3),
IF(AND(A7=53),M7/1000*$N$4,M7/1000*$O$4),
IF(AND(A7=54),M7/1000*$N$5,M7/1000*$O$5))

I have two primary conditions, either a one or two and four secondary
conditions, either 51, 52, 53, or 54. So if K7 = 1 and A7 = 51 divide
M7/1000 and multiply by O2. Evidently I have too many iterations for

this
to work. Is there another way to accomplish this? I am using Office 2000
and 2003.
Thanks,





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

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