Hi, I am trying to match a value that might appear in one of two columns.
My working in english is this:
IF (Sheet 2 Column D = Sheet1 A2) AND (Sheet2 Column A = Sheet1 H1)
INDEX (Return value from Sheet 2 Column C)
OR
IF (Sheet 2 Column C = Sheet1 A2) AND (Sheet2 Column A = Sheet1 H1)
INDEX (Return value from Sheet 2 Column D)
Where:
Sheet1
H1 (contains numerical value "1")
A2 (contains text "Home")
Sheet2
Column A (contains numerical values, "1,2,3" etc... equivalent to H1 in Sheet1)
Column C & D (contains text "home" and "away" ... equivalent to A2 in Sheet2)
If I just searched one range, this formula works:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Calibri; color: #000000}</style>
=INDEX(Sheet2!$C$1:$C$280,MATCH(1,(Sheet1!$H$1=Sheet2!$A$1:$A$280)*(Sheet1!$A2=Sheet2!$D$1:$D$280),0))
That returns the right value from column C, when we search D for A2. But how do I also return the right value from Column D, when we search C for A2? It would be great if after the formula above I could just write OR(INDEX(.... and just swap the "D" for "C" and vice versa. But I tried that and it didn't work.
Any help much appreciated!
My working in english is this:
IF (Sheet 2 Column D = Sheet1 A2) AND (Sheet2 Column A = Sheet1 H1)
INDEX (Return value from Sheet 2 Column C)
OR
IF (Sheet 2 Column C = Sheet1 A2) AND (Sheet2 Column A = Sheet1 H1)
INDEX (Return value from Sheet 2 Column D)
Where:
Sheet1
H1 (contains numerical value "1")
A2 (contains text "Home")
Sheet2
Column A (contains numerical values, "1,2,3" etc... equivalent to H1 in Sheet1)
Column C & D (contains text "home" and "away" ... equivalent to A2 in Sheet2)
If I just searched one range, this formula works:
<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Calibri; color: #000000}</style>
=INDEX(Sheet2!$C$1:$C$280,MATCH(1,(Sheet1!$H$1=Sheet2!$A$1:$A$280)*(Sheet1!$A2=Sheet2!$D$1:$D$280),0))
That returns the right value from column C, when we search D for A2. But how do I also return the right value from Column D, when we search C for A2? It would be great if after the formula above I could just write OR(INDEX(.... and just swap the "D" for "C" and vice versa. But I tried that and it didn't work.
Any help much appreciated!