ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   multiple conditions (https://www.excelbanter.com/excel-worksheet-functions/198273-multiple-conditions.html)

Sanjiv

multiple conditions
 
I have :

A B
1 10
2
3 11
4 11
5 10

I want to write a formula in Col A that
If B=10 then in col A1= have a value say "AB"
if B=11 then in col A1= have a value say "xy"
else
Col A1=blank

Kindly help and many thanks for that.


Mike H

multiple conditions
 
Try,


=IF(B1<"",CHOOSE(B1,,,,,,,,,,"AB","XY"),"")


Mike

"Sanjiv" wrote:

I have :

A B
1 10
2
3 11
4 11
5 10

I want to write a formula in Col A that
If B=10 then in col A1= have a value say "AB"
if B=11 then in col A1= have a value say "xy"
else
Col A1=blank

Kindly help and many thanks for that.


Teethless mama

multiple conditions
 
=INDEX({"AB","XY"},MATCH(B1,{10,11},0))


"Sanjiv" wrote:

I have :

A B
1 10
2
3 11
4 11
5 10

I want to write a formula in Col A that
If B=10 then in col A1= have a value say "AB"
if B=11 then in col A1= have a value say "xy"
else
Col A1=blank

Kindly help and many thanks for that.


T. Valko

multiple conditions
 
If you only have those 2 different variables:

=IF(B1=10,"AB",IF(B1=11,"xy",""))

If you have many variables then you should create a table and use a lookup
formula. See this:

http://contextures.com/xlFunctions02.html

--
Biff
Microsoft Excel MVP


"Sanjiv" wrote in message
...
I have :

A B
1 10
2
3 11
4 11
5 10

I want to write a formula in Col A that
If B=10 then in col A1= have a value say "AB"
if B=11 then in col A1= have a value say "xy"
else
Col A1=blank

Kindly help and many thanks for that.




Rick Rothstein \(MVP - VB\)[_1081_]

multiple conditions
 
As you are seeing from the responses, there are usually many different ways
to code a solution, some more efficient than others. It is always a good
idea to NOT simplify your examples as you apparently have done in your
question... there is no way to know what the most efficient solution is if
we do not know what you actually have to work with. I mean, if your posted
question was exactly what you really needed, then even this might could be
the correct answer for you...

=MID("ABxy",2*(B1-10)+1,2)

Rick


"Sanjiv" wrote in message
...
I have :

A B
1 10
2
3 11
4 11
5 10

I want to write a formula in Col A that
If B=10 then in col A1= have a value say "AB"
if B=11 then in col A1= have a value say "xy"
else
Col A1=blank

Kindly help and many thanks for that.




All times are GMT +1. The time now is 07:15 PM.

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