Mikkel Astrup
Mikkel Astrup

Reputation: 415

Excel IF multiple columns

Im working with a large excel questionnaire that i would like to simplify the data output for further evaluation. enter image description here

What I'm trying to make is an IF statement, so that if the X is in fueloil the P coloum will write Fueloil ect..

=IF(K2="X";K1)

However when I'm trying to add another IF statement excel returns VALUE. is IF the right way to go about this or is there another way of doing this?

Upvotes: 1

Views: 306

Answers (1)

teylyn
teylyn

Reputation: 35915

You don't need IF for this at all. You can use an Index/Match combo formula as demonstrated in the screenshot below. The formula in cell P2 is copied down.

=INDEX($K$1:$O$1,MATCH("x",K2:O2,0))

In words: Find the "x" in the current row and return the value from row 1 of that column.

If your regional settings require semicolons to separate parameters in formulas, please use

=INDEX($K$1:$O$1;MATCH("x";K2:O2;0))

enter image description here

Upvotes: 2

Related Questions