Nested confusion

mhumphries

New Member
Joined
Nov 26, 2015
Messages
5
Hello,
Looking for a solution to
Column K2:K126 contains different text search for a string (_X1 or _N1 or _S1, or _A10)
X = Hawk
N = Sparrow
S = Eagle
A = Owl

What i am wanting to do is, if(K2:K31 has _X1 return value Hawk or if (K2:K31) has _N1 then return value Sparrow etc

was looking at =IF(COUNTIF(K2:K31,"*_X*"),"Hawk","") this works, now need to expand to get other scenario to work
=IF(COUNTIF(K2:K31,"*_X*"),"Hawk",if(K2:K31,"*_N*","Sparrow,) or something....
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
What do you want the formula to return if more than one search string is in the range?
 
Upvote 0
I need the value to be either Hawk or Sparrow or Eagle or Owl depending on the value in the string
That doesn't answer the question: if more than one of the search strings is present in the range to be searched, what should the formula return?
 
Upvote 0
That doesn't answer the question: if more than one of the search strings is present in the range to be searched, what should the formula return?

Contents of column K is
00TUT_X1
00TUT_X3
00TUT_X2
00TUT_X4
00TUT_N1
00TUT_S1
00TUT_S3
00TUT_X3
00TUT_A3
00TUT_S4
00TUT_X5
00TUT_A1
00TUT_A2
00TUT_N3

<colgroup><col></colgroup><tbody>
</tbody>

In column M, I want to have either Hawk, Sparrow, Eagle or Owl.
In the column K data the _X should give Hawk in column M
In the column K data the _A should give Eagle in column M etc

Output needs to look like
Column K Column M
00TUT_X1Hawk
00TUT_X3Hawk
00TUT_X2Hawk
00TUT_X4Hawk
00TUT_N1Eagle
00TUT_S1Sparrow

<colgroup><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
Copy the formula in M1 down.
Excel Workbook
KLM
100TUT_X1Hawk
200TUT_X3Hawk
300TUT_X2Hawk
400TUT_X4Hawk
500TUT_N1Sparrow
600TUT_S1Eagle
700TUT_S3Eagle
800TUT_X3Hawk
900TUT_A3Owl
1000TUT_S4Eagle
1100TUT_X5Hawk
1200TUT_A1Owl
1300TUT_A2Owl
1400TUT_N3Sparrow
Sheet6
 
Upvote 0
Another way:

Row\Col
A​
B​
C​
1​
Input
Output
2​
00TUT_X1HawkB2: =LOOKUP(99, FIND("_" & {"A","N","S","X"}, A2), {"Owl","Eagle","Sparrow","Hawk"})
3​
00TUT_X3Hawk
4​
00TUT_X2Hawk
5​
00TUT_X4Hawk
6​
00TUT_N1Eagle
7​
00TUT_S1Sparrow
8​
00TUT_S3Sparrow
9​
00TUT_X3Hawk
10​
00TUT_A3Owl
11​
00TUT_S4Sparrow
12​
00TUT_X5Hawk
13​
00TUT_A1Owl
14​
00TUT_A2Owl
15​
00TUT_N3Eagle
 
Upvote 0
Another way:

Row\Col
A​
B​
C​
1​
Input
Output
2​
00TUT_X1HawkB2: =LOOKUP(99, FIND("_" & {"A","N","S","X"}, A2), {"Owl","Eagle","Sparrow","Hawk"})
3​
00TUT_X3Hawk
4​
00TUT_X2Hawk
5​
00TUT_X4Hawk
6​
00TUT_N1Eagle
7​
00TUT_S1Sparrow
8​
00TUT_S3Sparrow
9​
00TUT_X3Hawk
10​
00TUT_A3Owl
11​
00TUT_S4Sparrow
12​
00TUT_X5Hawk
13​
00TUT_A1Owl
14​
00TUT_A2Owl
15​
00TUT_N3Eagle

<tbody>
</tbody>
2 solutions, Both work, thanks guys!!
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

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