Comparing two Columns and pulling data from a third

Athirst5IoN

New Member
Joined
Mar 4, 2011
Messages
5
I am working with two sheets. One named RawData where I have imported data, and the main page I am using to work with the data.
I am trying to fill a column on the main page by comparing data in two columns and pulling over data from a corresponding third column. For example:

(Main)
Product Version Owner
a 1
b 3
c 4

(RawData)
id Product Owner Version
321 a john 2
516 a tim 1
123 b alex 3
984 c matt 2
195 b john 6
865 c alex 4

~ keep in mind there is much more info than this, but im just making a few simple columns for the example.

I want the cells in Main column C to be filled with the correct persons name that is in the same row as the correct Product and Version. Keep in mind I cannot just simply make a cell equal to another cell since the RawData sheet has thousands of rows of data. This is what I have so far:

=INDEX(RawData!C:C,MATCH(1,(A2=RawData!B:B)*(B2=RawData!D:D),0))

I'm fairly new at working with formulas and queries in excel. Could anyone help me with this?

Thanks in advance
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
I tried to make an example of the rows and columns but it seems to not take spaces and tabs into account once I post.
 
Upvote 0
Try this: just change the ranges for your data. It might run slow if you choose the whole column as your ranges.

=INDEX(RawData!$C$2:$C$7,MATCH(MainPage!A2&MainPage!B2,RawData!$B$2:$B$7&RawData!$D$2:$D$7,0))

then enter the formula with CTRL+SHIFT+ENTER, not just enter since it's an array formula.
 
Upvote 0
Try,

=INDEX(RawData!$C$2:$C$1000,MATCH(1,IF(RawData!$B$2:$B$1000=$A2,IF(RawData!$D$2:$D$1000=$B2,1)),0))

Confirmed with CTRL+SHIFT+ENTER, not just ENTER.

$A2=Product
$B2=Version

Or,

=LOOKUP(2,(RawData!$B$2:$B$100=A2)/(RawData!$D$2:$D$100=B2),RawData!$C$2:$C$100)
 
Last edited:
Upvote 0
Can you show what formula you are using?

Did you CTRL+SHFT+ENTER? it will have curly brackets {} around the formula.

The formula I sent works for me. You can try this one: same as before just a larger range.

=INDEX(RawData!$C$2:$C$65536,MATCH(MainPage!A2&MainPage!B2,RawData!$B$2:$B$65536&RawData!$D$2:$D$65536,0))
 
Upvote 0
I think I might see the problem confirm the worksheet names inthe formula. Are they "RawData" and "MainPage" or is it "Main" page. If that is it just rename the worksheet reference in the formula.

=INDEX(RawData!$C$2:$C$65536,MATCH(Main!A2&MainPage!B2,RawData!$B$2:$B$65536&RawData!$D$2:$D$65536,0))
 
Upvote 0
This is what I was using and yes I'm using CTRL+SHFT+ENTER:

=INDEX(RawData!$N$2:$N$39697,MATCH(1,(B10=RawData!$H$2:$H$39697)*(E10=RawData!$L$2:$L$39697),0))

I tried the more recent formula and is actually pulling data, but not the correct data.

=INDEX(RawData!$N$2:$N$39697,MATCH(PR9C!B27&PR9C!E27,RawData!$H$2:$H$39697&RawData!$L$2:$L$39697),0)

PR9C is the name of my main page. The forumula above is pulling information from the correct column (RawData column N), but it is pulling data that does not correspond with the Match. So i'm currently trying to figure out why that is.
 
Upvote 0

Forum statistics

Threads
1,224,519
Messages
6,179,263
Members
452,902
Latest member
Knuddeluff

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