Alternative Formula for Nested If/and Function

amp7394

New Member
Joined
Nov 16, 2018
Messages
8
I am currently trying to find a formula that allows me to return a text value based on the string of text in another cell if the cell fits a certain criteria. For example:

Cell A1: CIG-NA-NA / BSC-NCORP-A/ PLT-NA-NA/ GLD-NCORP-A

Based on this information, I want cell B1 to say: Non-Corp Gold

Cell A2: BSC-NCORP-A / GLD-NCORP-U / CIG-NA-NA / PLT-NCORP-A

B2: Non-Corp Platinum

(there are multiple possibilities for each cell containing the string of information)

I tried using a nested If formula (including and/or) but there are 35 possible outcomes that can result from a cell similar to A1 and A2 and Excel does not allow for this many If scenarios in one formula. Is there another formula that will work for this situation?
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Hi,
Welcome to the forum.
Am I correct in assuming the outcome “Non-Corp Gold” is defined by the last 11 characters of the text in cell A1. This appears to be true based on the two examples you have given.

If the above assumption is correct:-

  1. Crate a list of the last 11 characters elsewhere on the worksheet, in the formula example I have chosen G1:G35
  2. Next to these last eleven characters type the words you want to use, like “Non-Corp Gold” so they occupy the cells H1:H35

Use the following formula in cell B1
Code:
 =VLOOKUP(RIGHT(A1,11),$G$1:$H$35,2,FALSE)

If the assumption about the last eleven characters is wrong, you could use the whole text combo from column “A” and type it into column “G”, in which case the formula would be
Code:
 =VLOOKUP(A1,$G$1:$H$35,2,FALSE)

Cheers
Paul.
 
Upvote 0

Forum statistics

Threads
1,214,904
Messages
6,122,169
Members
449,070
Latest member
webster33

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