Forum Discussion
AAndry
Apr 29, 2021Copper Contributor
Search for data in 2 columns and return data from same row in 2 other columns
- Device and OS platform: MacOS Sierra 10.12.6
- Excel product name and version number: Microsoft Excel for Mac version: 15.27
- Excel file attached
- Context: I am trying to use an IF AND function and it's not working quite right. From Sheet 1 I need to search for a name and a period, if they are both found, then I need to copy over the course name and the teacher into sheet 2. I was able to get the first student and only for the first course, but then my formula won't work for the second or third student.
- Current formula that I have tried: =IF(AND(Sheet1!$A:$A=Sheet2!$A2,Sheet1!$B:$B=Sheet2!$B$1),Sheet1!C:C,"n/a")
- Ariana has a P3 period, but the value comes up as n/a instead of the course name and teacher for P3
Any help would be appreciated. I'm sure there's a better function out there, so please teach me your ways. Thank you!
See the attached version. I created the formulas in B2 and C2, filled them down to row 4, then copied B2:C4 and pasted it to the columns to the right.
2 Replies
See the attached version. I created the formulas in B2 and C2, filled them down to row 4, then copied B2:C4 and pasted it to the columns to the right.
- AAndryCopper Contributor
HansVogelaar of course! An index/match. Thank you so much!