IF a value from a list, report one of three options

tizdall

New Member
Joined
Apr 10, 2013
Messages
17
Hello!

If I have this list:

A1
A2
A3
A4
A5
B1
B2
B3
B4
B5
B6
B7
B8
C1
C2

<tbody>
</tbody>

In another sheet I have a cell where I want to populate 1 of 3 options based on whether the value in an adjacent cell is a part of the range I have defined in the list above.

The 3 options would be "Alpha" "Bravo" and "Charlie"

So, if these are my cells:

This is the value of the 'adjacent cell' = B7I need a formula to report "Bravo" because B7 is a part of the "Bravo" range (range defined by me in formula)

<tbody>
</tbody>

If the adjacent cell value would have been 'A1' then the cell to the right should report "Alpha" (same for 'C1' it should report "Charlie" etc)

I am thinking I need a hybrid IF(MATCH( formula but can't seem to find anything that works.


Any help would be appreciated!

Mark
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hello!

If I have this list:

A1
A2
A3
A4
A5
B1
B2
B3
B4
B5
B6
B7
B8
C1
C2

<tbody>
</tbody>

In another sheet I have a cell where I want to populate 1 of 3 options based on whether the value in an adjacent cell is a part of the range I have defined in the list above.

The 3 options would be "Alpha" "Bravo" and "Charlie"

So, if these are my cells:

This is the value of the 'adjacent cell' = B7I need a formula to report "Bravo" because B7 is a part of the "Bravo" range (range defined by me in formula)

<tbody>
</tbody>

If the adjacent cell value would have been 'A1' then the cell to the right should report "Alpha" (same for 'C1' it should report "Charlie" etc)

I am thinking I need a hybrid IF(MATCH( formula but can't seem to find anything that works.


Any help would be appreciated!

Mark

is your value in the cell =B7 which is reference to a cell or= "B7" which is actuall text value.
 
Upvote 0
If the Alpha, Bravo and Charlie are based on the first letter of the cell value here's one way to do it:

=IFERROR(CHOOSE(COLUMN(INDIRECT(LEFT(INDEX(A1:A15,MATCH(C2,A1:A15,0)),1)&"1")),"Alpha","Bravo","Charlie"),"Missing")

The formula finds the exact match first, then picks up the first digit from the left and tries to come up with a cell address with INDIRECT by combining it with 1. The columns of possible addresses would be 1-3 so the CHOOSE picks up the matching value from the given list. Placed the whole thing with IFERROR just to make it look nicer when the exact match is not found.

Using a lookup list would make the formula much easier to write, understand and modify.
 
Upvote 0
I should have used different examples for what I am going for as the alpha bravo charlie is misleading.

If the text value of a cell in the sheet can be found in range "a" (range defined by me) please report "Alpha"

If the text value of a cell in the sheet can be found in range "b" (range defined by me) please report "Beta"

If the text value of a cell in the sheet can be found in range "c" (range defined by me) please report "Charlie"


That's really all i need it to do, though, the auto reply based off the first digit is very cool! I may use that for a different project.
 
Upvote 0
I should have used different examples for what I am going for as the alpha bravo charlie is misleading.

If the text value of a cell in the sheet can be found in range "a" (range defined by me) please report "Alpha"

If the text value of a cell in the sheet can be found in range "b" (range defined by me) please report "Beta"

If the text value of a cell in the sheet can be found in range "c" (range defined by me) please report "Charlie"


That's really all i need it to do, though, the auto reply based off the first digit is very cool! I may use that for a different project.

By range do you mean a Named range anywhere in the worksheet or cells in column(Row 1-10, row 11-20....)?
 
Upvote 0
How would you specify a range?
The only way is to use Named Range for each part of your cell in column(row1:20="alpha"....)
But then you can not return the name of the range without using VBA or nested IFERROR statement.

Unless I'm missing something obvious here....
 
Upvote 0

Forum statistics

Threads
1,214,631
Messages
6,120,645
Members
448,974
Latest member
DumbFinanceBro

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top