how to combine left, right or mid function

Forestq

Active Member
Joined
May 9, 2010
Messages
482
Hi,

how can I read/select the number from the string as below:

for example:
A1: = "Audi A6, Poland - N123323 - SG"
A2: = "VW Polo, Denmark - (X) - N233217 CN"
A3: = "Ford Fiesta, Italy, XZ, (new) - N876233 - WW"

I wan to have only:
B1 = 123323
B2 = 233217
B3 = 876233
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
Try:

=MID(A1,FIND("- N",A1)+3,6)+0

or:

=-LOOKUP(1,-LEFT(MID(MID(A1,FIND(",",A1)+1,255),MIN(FIND(0,SUBSTITUTE(MID(A1,FIND(",",A1)+1,255),{1,2,3,4,5,6,7,8,9},0)&0)),255),ROW($1:$99)))
 
Upvote 0
thanks!

but if I have something like:

"Audi Poland -N16526-SG" or "VW Germany - N88822"

how to modify your code?
 
Upvote 0
How about using something like this:

=TRIM(MID(SUBSTITUTE(A1,"-"," "),FIND(" N",SUBSTITUTE(A1,"-"," "))+2,6))+0

or

This one is an array formula which requires you to use Ctrl, Shift Enter

=MID(REPLACE(A1,1,FIND(" -",A1),""),MATCH(TRUE,ISNUMBER(1*MID(REPLACE(A1,1,FIND(" -",A1),""),ROW($1:$99),1)),0),COUNT(1*MID(A1,ROW($1:$99),1)))+0
 
Upvote 0
when I used code:

=TRIM(MID(SUBSTITUTE(A27,"-"," "),FIND(" N",SUBSTITUTE(A27,"-"," "))+2,6))+0

I get error on strings:

GTA-DC & NAB-MNS Tran. & SEC-N19716-SG
FW COO182-N19716-SG
Group Audi-2343-N19766-SG
Area Of ShPC -N19600-SG
</SPAN>
</SPAN>
</SPAN>
</SPAN>
</SPAN>

<TBODY>
</TBODY><COLGROUP><COL></COLGROUP>
 
Upvote 0
when I used code:

=TRIM(MID(SUBSTITUTE(A27,"-"," "),FIND(" N",SUBSTITUTE(A27,"-"," "))+2,6))+0

I get error on strings:

GTA-DC & NAB-MNS Tran. & SEC-N19716-SG
FW COO182-N19716-SG
Group Audi-2343-N19766-SG
Area Of ShPC -N19600-SG

<tbody>
</tbody>
Anther shot...
Rich (BB code):
=LOOKUP(9.99999999999999E+307,
  --(LEFT(REPLACE(SUBSTITUTE(A1," ",""),1,1+LOOKUP(9.99999999999999E+307,
  FIND("-N",SUBSTITUTE(A1," ",""))),""),ROW(INDIRECT("1:16")))))
which covers the examples up to now.
 
Upvote 0

Forum statistics

Threads
1,214,642
Messages
6,120,700
Members
448,979
Latest member
DET4492

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