Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 8
Default 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.

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 11,501
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,718
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 15,768
Default 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.



  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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.


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
SUMPRODUCT or INDEX/MATCH for multiple conditions and multiple rec TravisB Excel Discussion (Misc queries) 21 March 16th 07 09:49 PM
How do I add multiple values that match multiple conditions? Joel Excel Discussion (Misc queries) 5 April 10th 06 01:32 PM
Multiple conditions and multiple return values Minerva Excel Worksheet Functions 3 February 16th 06 06:57 AM
Combining Text from multiple cells under multiple conditions KNS Excel Worksheet Functions 2 June 15th 05 11:00 PM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM


All times are GMT +1. The time now is 07:38 AM.

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"