Search for a number in a column of alpha numeric data and display only the non numeric data

questforexcel

Board Regular
Joined
Jan 18, 2019
Messages
128
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

So I have a column which has only numbers. For eg. 345678, 674567.

I want these individual numbers to be looked from a series of data which have corresponding Alphanumeric Values eg. 345678 - Computers, 674567 - Printers ...so on.

How do I place a formula which looks up the individual numbers above from alpha numeric values and displays only the non numeric values i.e. the text info.

I assume to ease the reference, the separating symbol is "-" .

I thought of using a vlookup but wouldnt know how would that differentiate the characters to the right of the "-".

Would appreciate all your help.

Thank you
 
The "*" is a wild card meaning "anything"
The Substitute function replaces the "-" with 100 spaces, the Rept( " ",100) and then the Right function takes the last 100 characters ( the final 100 in the formula)
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You may want to also consider this alternative.

Book1
LMN
5345678-PC123456laptop
6123456-laptop345678PC
7222222 
8 
Lookup
Cell Formulas
RangeFormula
N5:N8N5=IFNA(SUBSTITUTE(VLOOKUP(M5&"-*",L$5:L$10,1,0),M5&"-","",1),"")
 
Upvote 0
Thank you so much. This worked too :)

Could you help me understand how the formula reads the text when the "substitute" formula for the "new text" reads "". Isn't "" supposed to be read as blank?

Thank you

1574175944493.png


You may want to also consider this alternative.

Book1
LMN
5345678-PC123456laptop
6123456-laptop345678PC
7222222 
8 
Lookup
Cell Formulas
RangeFormula
N5:N8N5=IFNA(SUBSTITUTE(VLOOKUP(M5&"-*",L$5:L$10,1,0),M5&"-","",1),"")
 
Upvote 0
Thank you so much for this explanation and help! Much much appreciated :)


The "*" is a wild card meaning "anything"
The Substitute function replaces the "-" with 100 spaces, the Rept( " ",100) and then the Right function takes the last 100 characters ( the final 100 in the formula)
 
Upvote 0
Just an edit fix requested on this. I now have come across a second set of data which has two "-" in one alpha numeric cell.

Eg.

789878 - Copiers - Colour
654698 - Copiers - Black & White

With the above formulas it is displaying "Colour" "Black & White" in results in place of "Copiers - Colour" and "Copiers - Black & White"

How Do I ensure the formula picks and removes characters before the first "-" or reads all characters after the first "-"

Thank you
 
Upvote 0
Peter's formula already does that, with mine use
=IFERROR(TRIM(RIGHT(SUBSTITUTE(INDEX($L$5:$L$10,MATCH(M5&"*",$L$5:$L$10,0)),"-",REPT(" ",100),1),100)),"")
 
Upvote 0
Thank you for this quick response and help :) It worked.

I had first tried using peters formula but it read it as blanks due to extra spaces in these cell values. Your formula did read the data without the extra spaces.

However, for consistency I was trying to reduce the extra spaces in this data set but it didnt work. I used the formula below. This surprisingly worked on the 1st
data set. Thank you
=TRIM(CLEAN(SUBSTITUTE(D8,CHAR(160)," ")))
 
Upvote 0
You're welcome & thanks for the feedback
 
Upvote 0
Surely. :)

Sorry one last bit on my formula above to remove the extra spaces in the alphanumeric cell. Is my formula above not correct?

=TRIM(CLEAN(SUBSTITUTE(D8,CHAR(160)," ")))

Cause it does not remove the extra spaces between the numbers and "-".

Thank you
 
Upvote 0
No that will only remove multiple contiguous spaces.
 
Upvote 0

Forum statistics

Threads
1,223,705
Messages
6,173,986
Members
452,541
Latest member
haasro02

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