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
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
I believe you're misstating rows and columns because your written statement doesn't match your example.
Do the 7-digits always begin with H? Is there always a second letter after the H? Could there be an H elsewhere in the cell?
Also, is there a LF/CR after the first line in the 1st row of each column?
 
Upvote 0
Code:
=MID(A1,FIND(" H",A1)+1,7)

Assumes there are no other strings that begin with " H" that appear before your string.
This would not work for "I Am Healthy HX123Z9"
But will work for "I am healthy HX123Z9"
 
Upvote 0
Code:
=MID(A1,FIND(" H",A1)+1,7)

Assumes there are no other strings that begin with " H" that appear before your string.
This would not work for "I Am Healthy HX123Z9"
But will work for "I am healthy HX123Z9"

The writing pattern he presented seems to work without the need for '+1'. But all kinds of redundancy to avoid problems are very much appreciated.
 
Upvote 0
My "+1" avoids picking up the space before the "H".
 
Upvote 0
This would not work for "I Am Healthy HX123Z9"
Changing the formula slightly would eliminate the majority of strings of more or less than 7 characters by sacrificing the upper case H check.

=TRIM(MID(" "&A1&" ",SEARCH(" H?????? "," "&A1&" "),9))

To make the formula more accurate than any of the current suggestions would probably need an array to evaluate each individual character.
 
Upvote 0
Well, if there is a hierarchy here I am just an aspiring recruit speaking to two senior officers, but I prefer to be as simple as possible because the "simplicity is the maximum degree of sifistication". Da vinci

Have a nice day!
 
Upvote 0

Forum statistics

Threads
1,215,036
Messages
6,122,794
Members
449,095
Latest member
m_smith_solihull

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