MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Compare 2 Cells for an entry......


Posted by EBA on September 12, 2000 8:13 AM

I need a quick solution to what I know is an easy formula I am just so rusty with Excel anymore.

Cell A1 = A
Cell B1 = B
Cell A2 = 21
Cell B2 = 11

What I want todo is look at Cells A2 and B2 and whichever matches 21 I want to return the header cell. (ie A or B)


Posted by Celia on September 12, 0100 2:50 PM

EBA

=IF(AND(A2=21,B2=21),A1&" & "&B1,IF(A2=21,A1,IF(B2=21,B1,"")))

Celia