Extract only specific 2 numbers

motilulla

Well-known Member
Joined
Feb 13, 2008
Messages
2,362
Office Version
  1. 2010
Hello,

From my result column B6:F33 I want to extract only 2 numbers that are listed in the cells H2 & H3 and show them into column cells H6:H33.

*ABCDEFGHI
1
2num16
3num29
4
5n1n2n3n4n5Result
61629323641
771369506 | 9
81418193137
947333739
101689476 | 9
113336374245
1234102343
13412242736
1414101923
151415283540
166789496 | 9
17561623276
181516213638
1916932396 | 9
201529373949
216789126 | 9
229133441429
232781047
24223284043
25321303435
26423242834
27234566
282426313850
297102731349
309101937506 | 9
31515243544
322027414350
33691027356 | 9
34
35
36
37

Thank you all.

I am using Excel 2000

Regards,
Moti
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
Try something like
Excel Formula:
=TRIM(SUBSTITUTE(IF(ISNUMBER(MATCH($H$2,B6:F6,0)),$H$2&" ","")&IF(ISNUMBER(MATCH($H$3,B6:F6,0))," "&$H$3,""),"  ","|"))
 
Upvote 0
Solution
It doesn't have to be at the top.
 
Upvote 0
Try something like
Excel Formula:
=TRIM(SUBSTITUTE(IF(ISNUMBER(MATCH($H$2,B6:F6,0)),$H$2&" ","")&IF(ISNUMBER(MATCH($H$3,B6:F6,0))," "&$H$3,""),"  ","|"))


Fluff, the formula works like magic! Thank you very much for your kind help and time you spend solve it.

Good Luck to you and have a nice time.

Kind Regards,
Moti :)
 
Last edited:
Upvote 0
The formula was supplied by Misca. So that's who you should be thanking ;)
 
Upvote 0
The formula was supplied by Misca. So that's who you should be thanking ;)
Fluff, I am Sorry I cannot edit your name in the above post# because the edit time is over thank you for pointing me it is my mistake not reading the post correctly.

Kind Regards,
Moti

Try something like
Excel Formula:
=TRIM(SUBSTITUTE(IF(ISNUMBER(MATCH($H$2,B6:F6,0)),$H$2&" ","")&IF(ISNUMBER(MATCH($H$3,B6:F6,0))," "&$H$3,""),"  ","|"))

sandy666, the formula you supplied works like magic! Thank you very much for your kind help and time you spend solve it.​


Good Luck to you and have a nice time.

Kind Regards,
Moti :)
 
Last edited:
Upvote 0
Did you actually read my post? ;)
The formula was not supplied by Sandy666 nor by myself, but by Misca.
 
Upvote 0
Did you actually read my post? ;)
The formula was not supplied by Sandy666 nor by myself, but by Misca.
Hello Fluff, I am extremely sorry as this has site been developed new I got confuse reading and replying post correctly I think I got jump to another post and pick the name wrongly I apologise for my mistake

Kind Regards,
Moti ?
Try something like
Excel Formula:
=TRIM(SUBSTITUTE(IF(ISNUMBER(MATCH($H$2,B6:F6,0)),$H$2&" ","")&IF(ISNUMBER(MATCH($H$3,B6:F6,0))," "&$H$3,""),"  ","|"))
Misca, the formula you supplied works like magic! Thank you very much for your kind help and time you spend solve it.

I am very sorry about the confusion I have created.

Good Luck to you and have a nice time.

Kind Regards,
Moti :)
 
Upvote 0
Here is a simpler formula that should also work for you...
Excel Formula:
=MID(IF(COUNTIF(B6:F6,H$2)," | "&H$2,"")&IF(COUNTIF(B6:F6,H$3)," | "&H$3,""),4,99)
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,388
Messages
6,124,641
Members
449,177
Latest member
Sousanna Aristiadou

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