ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Nested And function (https://www.excelbanter.com/excel-worksheet-functions/102610-nested-function.html)

Kelvin Pek

Nested And function
 
I i have more than 7 nested level like the following what can be done?
=IF(AND(F11="Ma",G11="R"),"M",
(IF(AND(F11="Ma",G11="O"),"H",
IF(AND(F11="Ma",G11="F"),"H",
IF(AND(F11="Mo",G11="R"),"L",
IF(AND(F11="Mo",G11="O"),"M",
IF(AND(F11="Mo",G11="F"),"H",
IF(AND(F11="Mi",G11="R"),"L",.....))))))))

Actually i only have 9 level and so i am shortfall of 2 to complete my
formulas.... andyone can help????



JMB

Nested And function
 
This seemed to work okay for me.

=INDEX({"M","H","H","L","M","H","H","L"},MATCH(F11 &G11,{"MaR","MaO","MaF","MoR","MoO","MoF","MiR"},0 ))

Alternatively, create a table like this

A B
1 MaR M
2 MaO H
3 MaF H

and use VLOOKUP(F11&G11, A1:B3, 2, FALSE)

Change the reference A1:B3 to wherever you put your table.



"Kelvin Pek" wrote:

I i have more than 7 nested level like the following what can be done?
=IF(AND(F11="Ma",G11="R"),"M",
(IF(AND(F11="Ma",G11="O"),"H",
IF(AND(F11="Ma",G11="F"),"H",
IF(AND(F11="Mo",G11="R"),"L",
IF(AND(F11="Mo",G11="O"),"M",
IF(AND(F11="Mo",G11="F"),"H",
IF(AND(F11="Mi",G11="R"),"L",.....))))))))

Actually i only have 9 level and so i am shortfall of 2 to complete my
formulas.... andyone can help????



Kelvin Pek

Nested And function
 
Thanks Pal

Regards
Kelvin Pek

"JMB" wrote:

This seemed to work okay for me.

=INDEX({"M","H","H","L","M","H","H","L"},MATCH(F11 &G11,{"MaR","MaO","MaF","MoR","MoO","MoF","MiR"},0 ))

Alternatively, create a table like this

A B
1 MaR M
2 MaO H
3 MaF H

and use VLOOKUP(F11&G11, A1:B3, 2, FALSE)

Change the reference A1:B3 to wherever you put your table.



"Kelvin Pek" wrote:

I i have more than 7 nested level like the following what can be done?
=IF(AND(F11="Ma",G11="R"),"M",
(IF(AND(F11="Ma",G11="O"),"H",
IF(AND(F11="Ma",G11="F"),"H",
IF(AND(F11="Mo",G11="R"),"L",
IF(AND(F11="Mo",G11="O"),"M",
IF(AND(F11="Mo",G11="F"),"H",
IF(AND(F11="Mi",G11="R"),"L",.....))))))))

Actually i only have 9 level and so i am shortfall of 2 to complete my
formulas.... andyone can help????



JMB

Nested And function
 
You're welcome.

"Kelvin Pek" wrote:

Thanks Pal

Regards
Kelvin Pek

"JMB" wrote:

This seemed to work okay for me.

=INDEX({"M","H","H","L","M","H","H","L"},MATCH(F11 &G11,{"MaR","MaO","MaF","MoR","MoO","MoF","MiR"},0 ))

Alternatively, create a table like this

A B
1 MaR M
2 MaO H
3 MaF H

and use VLOOKUP(F11&G11, A1:B3, 2, FALSE)

Change the reference A1:B3 to wherever you put your table.



"Kelvin Pek" wrote:

I i have more than 7 nested level like the following what can be done?
=IF(AND(F11="Ma",G11="R"),"M",
(IF(AND(F11="Ma",G11="O"),"H",
IF(AND(F11="Ma",G11="F"),"H",
IF(AND(F11="Mo",G11="R"),"L",
IF(AND(F11="Mo",G11="O"),"M",
IF(AND(F11="Mo",G11="F"),"H",
IF(AND(F11="Mi",G11="R"),"L",.....))))))))

Actually i only have 9 level and so i am shortfall of 2 to complete my
formulas.... andyone can help????




All times are GMT +1. The time now is 03:26 AM.

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