ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   How do I set up a conditional function in Excel (https://www.excelbanter.com/excel-worksheet-functions/50267-how-do-i-set-up-conditional-function-excel.html)

Kamsa

How do I set up a conditional function in Excel
 
Help, I think I have done this before but cannot remember or how I did it.

For a risk log, I want a formular that will pick up from 2 cells a number of
combinations and give me the result in the third cell

ie. Risk If cell a is "L" and cell b "L@ then cell c should be "L"
however if a is "L" and cell b is "M" then cell c should "M"
and if a is "L and b is "H" then c should be "M"
and if a is "M" and b is "H" then c should "H"



Bob Phillips

=IF(A2="L",IF(B2="L","L",IF(OR(B2="M",B2="H"),"M", "")),IF(AND(A2="M",B2="H")
,"H",""))

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Kamsa" wrote in message
...
Help, I think I have done this before but cannot remember or how I did it.

For a risk log, I want a formular that will pick up from 2 cells a number

of
combinations and give me the result in the third cell

ie. Risk If cell a is "L" and cell b "L@ then cell c should be "L"
however if a is "L" and cell b is "M" then cell c should "M"
and if a is "L and b is "H" then c should be "M"
and if a is "M" and b is "H" then c should "H"





Peo Sjoblom

One way

=IF(AND(A1="L",B1="L@"),A1,IF(AND(A1="L",B1="M"),B 1,IF(AND(A1="L",B1="H"),"M
",IF(AND(A1="M",B1="H"),B1,""))))

assuming that if neither of the conditions are true, blank result


Regards,

Peo Sjoblom


"Kamsa" wrote in message
...
Help, I think I have done this before but cannot remember or how I did it.

For a risk log, I want a formular that will pick up from 2 cells a number

of
combinations and give me the result in the third cell

ie. Risk If cell a is "L" and cell b "L@ then cell c should be "L"
however if a is "L" and cell b is "M" then cell c should "M"
and if a is "L and b is "H" then c should be "M"
and if a is "M" and b is "H" then c should "H"





Max

One way ..

Assuming lookup values in cols A and B, from row1 down

Put in the formula bar for C1,
array-enter (press CTRL+SHIFT+ENTER):

=INDEX({"L";"M";"M";"H"},
MATCH(1,(A1={"L";"L";"L";"M"})*(B1={"L@";"M";"H";" H"}),0))

Copy C1 down
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Kamsa" wrote in message
...
Help, I think I have done this before but cannot remember or how I did it.

For a risk log, I want a formular that will pick up from 2 cells a number

of
combinations and give me the result in the third cell

ie. Risk If cell a is "L" and cell b "L@ then cell c should be "L"
however if a is "L" and cell b is "M" then cell c should "M"
and if a is "L and b is "H" then c should be "M"
and if a is "M" and b is "H" then c should "H"





Bob Phillips

I think the @ was a typo, there was no closing quote. I made the same
mistake until I saw the hyperlinking <G

Bob

"Max" wrote in message
...
One way ..

Assuming lookup values in cols A and B, from row1 down

Put in the formula bar for C1,
array-enter (press CTRL+SHIFT+ENTER):

=INDEX({"L";"M";"M";"H"},
MATCH(1,(A1={"L";"L";"L";"M"})*(B1={"L@";"M";"H";" H"}),0))

Copy C1 down
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--
"Kamsa" wrote in message
...
Help, I think I have done this before but cannot remember or how I did

it.

For a risk log, I want a formular that will pick up from 2 cells a

number
of
combinations and give me the result in the third cell

ie. Risk If cell a is "L" and cell b "L@ then cell c should be "L"
however if a is "L" and cell b is "M" then cell c should "M"
and if a is "L and b is "H" then c should be "M"
and if a is "M" and b is "H" then c should "H"







Max

"Bob Phillips" wrote
I think the @ was a typo, there was no closing quote. I made the same
mistake until I saw the hyperlinking <G


Aha, you're right, I fell for it, just like Peo <g
Great razor-sharp eyesight there, Bob !
--
Rgds
Max
xl 97
---
Singapore, GMT+8
xdemechanik
http://savefile.com/projects/236895
--



Alok

Another way which uses an in memory table and vlookup.

=IF(ISNA(VLOOKUP(A1 &
B1,{"LL","L";"LM","M";"LH","M";"MH","H"},2,FALSE)) ,"",VLOOKUP(A1 &
B1,{"LL","L";"LM","M";"LH","M";"MH","H"},2,FALSE))

Alok

"Kamsa" wrote:

Help, I think I have done this before but cannot remember or how I did it.

For a risk log, I want a formular that will pick up from 2 cells a number of
combinations and give me the result in the third cell

ie. Risk If cell a is "L" and cell b "L@ then cell c should be "L"
however if a is "L" and cell b is "M" then cell c should "M"
and if a is "L and b is "H" then c should be "M"
and if a is "M" and b is "H" then c should "H"




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

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