Vignesh Subramanian
Vignesh Subramanian

Reputation: 7289

check multiple conditions in excel and return column name

Hello I have four columns in excel. in the fifth column I need to store the column name which is having value as 1 (only one will have 1)

=IF(A=1, "A", "False")

What i want to acheive is, I want to set the column name which has 1 in it do i need to do the above formula four times ?! please help

if A=1 return A
if B=1 return B
if C=1 return C
if D=1 return D

Upvotes: 0

Views: 561

Answers (1)

Peter Albert
Peter Albert

Reputation: 17475

Try this formula:

=CHOOSE(MATCH(1,A1:D1,0),"A","B","C","D")

alternatively, this will also work:

=CHAR(64+MATCH(1,A1:D1,0))

Upvotes: 1

Related Questions