Capital letters in formula

lukasz_rz

New Member
Joined
Oct 13, 2013
Messages
48
Dear Experts.

I Have a table (example):
column AD column AE
CAT CT
dog DG
elephant EL

Then, I have a column (O2) where I try to find strings from the above (CAT, dog, elephant) and display those as CT,DG,EL in a new column.

VBA Code:
INDEX(Lists!AE:AE;AGGREGATE(15;6;ROW(Lists!$AE$2:$AE$7)/(COUNTIF(O2;Lists!$AD$2:$AD$7)>0);1)

But, the formula displays CT for any of these: CAT, cat, Cat, etc. What I need is to display CT only when CAT string is found, is that possible?

Will appreciate your help, thanks.
 

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.
Hi, here is one option you can try.

Excel Formula:
=LOOKUP(2;1/EXACT(Lists!$AD$2:$AD$1000;O2);Lists!$AE$2:$AE$1000)
 
Upvote 0
Perhaps:

Excel Formula:
=INDEX(Lists!AE:AE,AGGREGATE(15,6,ROW(Lists!$AE$2:$AE$7)/(EXACT(O2,Lists!$AD$2:$AD$7)+0),1))
 
Upvote 0
Hi lukasz_rz,

Does this work for you?

lukasz_rz.xlsx
OPQACADAE
1CheckResultAnimalAbbrev.
2CATCTCATCT
3Cat MOUSEMS
4Dog DOGDG
5SHEEPSHPIGPG
6PIGPGSHEEPSH
7Pig 
Lists
Cell Formulas
RangeFormula
P2:P7P2=IFERROR(INDEX(Lists!AE:AE,AGGREGATE(15,6,ROW(Lists!$AE$2:$AE$7)/(EXACT(O2,Lists!$AD$2:$AD$7)),1)),"")
 
Upvote 0
Thanks FormR, have not seen the use of EXACT in a look before.
I googled the Match version it that and it would look like this.

Excel Formula:
=INDEX(Lists!AE:AE,MATCH(TRUE,EXACT(O2,Lists!AD:AD),0),0)
 
Upvote 0
Toadstool.

It partially works, but there is one more element it does not cover. I'm not only looking for exact matches but also cases like: CAT is black (in Check column) which contains CAT (from Animal column), so should be marked as CT (Result column).

I should've mentioned exactly how my columns look like, sorry:
column AD column AE
*CAT* CT
*dog* DG
*elephant* EL
 
Last edited:
Upvote 0
You could use:

=LOOKUP(2,1/FIND(O2,Lists!$AD$2:$AD$1000),Lists!$AE$2:$AE$1000)

then you don't need the wildcards.
 
Upvote 0
Toadstool.

It partially works, but there is one more element it does not cover. I'm not only looking for exact matches but also cases like: CAT is black (in Check column) which contains CAT (from Animal column), so should be marked as CT (Result column).

I should've mentioned exactly how my columns look like, sorry:
column AD column AE
*CAT* CT
*dog* DG
*elephant* EL
This approach doesn't want the wildcards so the "*" are stripped:

lukasz_rz.xlsx
OPQACADAE
1CheckResultAnimalAbbrev.
2The CAT in the hatCT*CAT*CT
3The Black Cat *MOUSE*MS
4Good Doggy *DOG*DG
5GOOD DOGGYDG*PIG*PG
6PIG in a POKEPG*SHEEP*SH
7Pig *GOAT*GT
Lists
Cell Formulas
RangeFormula
P2:P7P2=IFERROR(INDEX(Lists!AE:AE,AGGREGATE(15,6,ROW(Lists!$AE$2:$AE$7)/(ISNUMBER(FIND(SUBSTITUTE(Lists!$AD$2:$AD$7,"*",""),O2))),1)),"")
 
Upvote 0
Solution

Forum statistics

Threads
1,215,228
Messages
6,123,747
Members
449,118
Latest member
kingjet

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