How to extract data from 2 columns?

saltwater

New Member
Joined
Feb 19, 2014
Messages
29
Hello,

I have a list of part numbers (some are repeated) in column A

In column B I have quantities.

I need to extract all part numbers in column A that are part number 111111 along with the adjacent quantity in column B.

Column A Column B
111111 45
123456 11
789654 12
123456 10
111111 55
111111 65

The data I am looking for in the new cells should like this...
Column C Column D
111111 45
111111 55
111111 65

How can I accomplish this?
 
Last edited:

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
Re: How to extract data from 2 colmuns?

maybe something like...

A9 - value you are looking up

B9 =COUNTIF(A2:A7,A9)

A10=IF(ROWS($A$10:A10)>$B$9,"",INDEX(A$2:A$7,SMALL(IF($A$2:$A$7=$A$9,ROW(A$2:A$7)-ROW(A$2)+1),ROWS(A$10:A10)))) control shift enter

B10=IF(ROWS($A$10:B10)>$B$9,"",INDEX(B$2:B$7,SMALL(IF($A$2:$A$7=$A$9,ROW(B$2:B$7)-ROW(B$2)+1),ROWS(B$10:B10)))) control shift enter


Row\Col
A​
B​
1​
ColumnAColumnB
2​
111111
45​
3​
123456
11​
4​
789654
12​
5​
123456
10​
6​
111111
55​
7​
111111
65​
8​
9​
111111
3​
10​
111111​
45​
11​
111111​
55​
12​
111111​
65​
13​
14​
15​

<tbody>
</tbody>
 
Upvote 0
You can use an Index - Match Array to retrieve the Nth match of the listed part#.


Excel 2010
ABCD
11111114511111145
21234561111111155
37896541211111165
412345610
511111155
611111165
Sheet3
Cell Formulas
RangeFormula
D1{=IF(ISERROR(INDEX(A:B,SMALL(IF(A:A=$C1,ROW(A:A)),ROW(1:1)),2)),"",INDEX(A:B,SMALL(IF(A:A=$C1,ROW(A:A)),ROW(1:1)),2))}
Press CTRL+SHIFT+ENTER to enter array formulas.


Here's an article you might read up on.
 
Upvote 0
Thank you both for your responses.

Calsux78, how come my cell returns blank with this version?

=IF(ISERROR(INDEX($S$801:$T$1101,SMALL(IF($S$801:$S$1101=$M1103,ROW(S801:S1101)),ROW($S$801:$T$1101)),2)),"",INDEX($S$801:$T$1101,SMALL(IF($S$801:$S$1101=$M1103,ROW($S$801:$S$1101)),ROW(S801:T1101)),2))

I do enter with (Ctrl+Shift+Enter) no issues there.
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,716
Members
449,093
Latest member
Mnur

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