Very tricky question

mark_ink

New Member
Joined
Jan 12, 2016
Messages
2
Here I'd like to find the way to get starting 3 letters of every country.
paste these values into Column A

ie.
AUS for Australia
IND for India

Many thanks


[TABLE="width: 155"]
<tbody>[TR]
[TD][TABLE="width: 277"]
<tbody>[TR]
[TD]001-01-Australia-02-06[/TD]
[/TR]
[TR]
[TD]12-2-Japan-65[/TD]
[/TR]
[TR]
[TD]236-01-India-45-01[/TD]
[/TR]
[TR]
[TD]1401-3-Singapore-458-1[/TD]
[/TR]
[TR]
[TD]456-01-France-456-2[/TD]
[/TR]
[TR]
[TD]12-9-China-45-69[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Well, that was easy, 2-3 mins though I've done something like this before

=UPPER(LEFT(TRIM(MID(SUBSTITUTE(A1,"-",REPT(" ",500)),1000,500)),3))
 
Last edited:
Upvote 0
Here's another possible option:


Excel 2013
AB
1AUS001-01-Australia-02-06
2***12-2-Japan-65
3IND236-01-India-45-01
4SIN1401-3-Singapore-458-1
5FRA456-01-France-456-2
6CHI12-9-China-45-69
Sheet1
Cell Formulas
RangeFormula
A1=UPPER(MID(B1,FIND("-",SUBSTITUTE(B1,"-","#",1))+1,3))
 
Upvote 0
Welcome to Mr Excel

Maybe...


[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]
001-01-Australia-02-06​
[/TD]
[TD]
AUS​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
12-2-Japan-65​
[/TD]
[TD]
***​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
236-01-India-45-01​
[/TD]
[TD]
IND​
[/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
1401-3-Singapore-458-1​
[/TD]
[TD]
SIN​
[/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
456-01-France-456-2​
[/TD]
[TD]
FRA​
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
12-9-China-45-69​
[/TD]
[TD]
CHI​
[/TD]
[/TR]
</tbody>[/TABLE]


Formula in B1 copied down
=UPPER(MID(A1,SEARCH("|",SUBSTITUTE(A1,"-","|",2))+1,3))

Hope this helps

M.
 
Last edited:
Upvote 0
Thanks :)
Welcome to Mr Excel

Maybe...


[TABLE="class: grid"]
<tbody>[TR]
[TD][/TD]
[TD]
A
[/TD]
[TD]
B
[/TD]
[/TR]
[TR]
[TD]
1
[/TD]
[TD]
001-01-Australia-02-06​
[/TD]
[TD]
AUS​
[/TD]
[/TR]
[TR]
[TD]
2
[/TD]
[TD]
12-2-Japan-65​
[/TD]
[TD]
***​
[/TD]
[/TR]
[TR]
[TD]
3
[/TD]
[TD]
236-01-India-45-01​
[/TD]
[TD]
IND​
[/TD]
[/TR]
[TR]
[TD]
4
[/TD]
[TD]
1401-3-Singapore-458-1​
[/TD]
[TD]
SIN​
[/TD]
[/TR]
[TR]
[TD]
5
[/TD]
[TD]
456-01-France-456-2​
[/TD]
[TD]
FRA​
[/TD]
[/TR]
[TR]
[TD]
6
[/TD]
[TD]
12-9-China-45-69​
[/TD]
[TD]
CHI​
[/TD]
[/TR]
</tbody>[/TABLE]


Formula in B1 copied down
=UPPER(MID(A1,SEARCH("|",SUBSTITUTE(A1,"-","|",2))+1,3))

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,912
Members
452,366
Latest member
TePunaBloke

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