# An easier lookup formula ?

#### johnny52

##### Active Member
I have four columns and five rows.....I have a formula that works, but there must be an easier way

this is what I'm using,maybe it can be condensed. I might want to expand the formula to accommodate more columns, but for now

=IF(M4=N4,O4+P4,IF(M4=N5,O4+P5,IF(M4=N6,O4+P6,IF(M4=N7,O4+P7,IF(M4=N8,O4+P8,"")))))

Thanks for help

#### Special-K99

##### Well-known Member
Try this

=IFERROR(O4+INDEX(P4:P8,MATCH(M4,N4:N8,0),1),"")

Expand P4:P8 N4:N8 ranges as required

Last edited:

#### Marcelo Branco

##### MrExcel MVP
Don't understand what you mean by
"I might want to expand the formula to accommodate more columns,.."

Your formula above can be simplified to
=IFERROR(O4+INDEX(P4:P8,MATCH(M4,N4:N8,0)),"")

M.

#### johnny52

##### Active Member
Worked great (both responses)

much appreciated!

Thanks

#### Special-K99

##### Well-known Member
Don't understand what you mean by
"I might want to expand the formula to accommodate more columns,.."

Your formula above can be simplified to
=IFERROR(O4+INDEX(P4:P8,MATCH(M4,N4:N8,0)),"")

M.
Yep I think he meant rows

### Forum statistics

1,082,323
Messages
5,364,584
Members
400,809
Latest member
formulasataglance

### This Week's Hot Topics

• populate from drop list with multiple tables
Hi All, i have a drop list that displays data, what i want is when i select one of those from the list to populate text from different tables on...
• Find list of words from sheet2 in sheet1 before a comma and extract text vba
Hi Friends, Trying to find the solution on my task. But did not find suitable one to the need. Here is my query and sample file with details...
• Dynamic Formula entry - VBA code sought
Hello, really hope one of you experts can help with this - i've spent hours on this and getting no-where. .I have a set of data (more rows than...