Need Help On Formula

ranjith2523

Board Regular
Joined
Apr 29, 2014
Messages
137
Office Version
  1. 365
Hi Friends,

I need the formula to get a specific value from a cell. I tried SEARCH, MID, LEFT, RIGHT but none of the formulae is working for me.

In Cell A1, I have a paragraph and likewise in cell A2 and A3. In cell B1, B2, B3 I need to apply a formula to pick the 7 digit value which starts with H and ends with any number. The value will be always 7 digits and start with H and ends with a number.

Foundation w/RTNV Support HJ804A2
2Y DSP 9x5
Rotate w/RTNV Support HK715A1
2Y DSP
Basic HA611A5 Support
2Y DSP
HJ804A2HK715A1HA611A5

I hope someone will help me to find out a solution here.

Thanks for all your help in advance.

Regards,
Ranjith
 
Can you give me one example in what scenario the above-modified formula will not work
Any cell with 'H' or 'h' before the correct string to extract.

As I said in an earlier reply, my formula is not perfect, it can not see the difference between numbers and letters, so any combination of 7 characters beginning with H and surrounded by spaces would still be a problem, this can be seen in the last entry below. A 'Fix' for this would require a much more complicated formula, if it is even possible.

Book1
BC
1without spaces H6EV0A1hout sp
2with spaces H6EV0A1H6EV0A1
Sheet2
Cell Formulas
RangeFormula
C1C1=MID(" "&SUBSTITUTE(B1,CHAR(10)," ")&" ",SEARCH("H??????"," "&SUBSTITUTE(B1,CHAR(10)," ")&" "),7)
C2C2=TRIM(MID(" "&SUBSTITUTE(B2,CHAR(10)," ")&" ",SEARCH(" H?????? "," "&SUBSTITUTE(B2,CHAR(10)," ")&" "),9))
 
Upvote 0

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Forum statistics

Threads
1,214,626
Messages
6,120,602
Members
448,974
Latest member
ChristineC

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