Compared 2 conditions and copy value from another column

pochitodiaz

New Member
Joined
Apr 2, 2015
Messages
6
Hello,

I have an issue that I have been working on for a bit now, but I can't seem to figure it out. I have 2 sheets with lots of information on it. I want to compared the values from Sheet1 column A and column D to the values on Sheet2 Column A and column B and if they match copy Sheet2 Column C to Sheet1 Column C. The issue is that the data on Sheet2 is not always going to have the same values for column B. To clarify see tables below, Sheet 1 has all the names of the people that are part of my team (Name1 & Name2) and the week number, but Sheet2 will only have the name of the people that have a value to report for the specific week. I tried using
=IFERROR(INDEX(Sheet2!A:C,MATCH(B:B,Sheet2!B:B,0),3),0) but because Name2 is missing for week1 on sheet2 it returns the value of week2 to the first sheet which is incorrect. Is there a way to accomplish this?

Sheet 1
ABC
Week1Name1
Week1Name2
Week2Name1
Week2Name2

<tbody>
</tbody>









Sheet 2
ABC
Week1Name12
Week2Name11
Week2Name23

<tbody>
</tbody>
 

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Hello,

I think I have finally figured it out.

=IFERROR(INDEX(Sheet2!A:C,MATCH(1,(Sheet2!A:A=A2)*(Sheet2!B:B=B2),0),3),0)

This formula is doing what I was trying to do. I am sure there is a lot of other ways to do it, but posting it here in case it helps someone in the future :)
 
Upvote 0

Forum statistics

Threads
1,214,951
Messages
6,122,442
Members
449,083
Latest member
Ava19

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