An easier lookup formula ?

johnny52

Active Member
Joined
Oct 13, 2006
Messages
332
Office Version
  1. 2010
  2. 2007
Platform
  1. Windows
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
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Try this

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

Expand P4:P8 N4:N8 ranges as required
 
Last edited:
Upvote 0
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.
 
Upvote 0
Worked great (both responses)

much appreciated!

Thanks
 
Upvote 0

Forum statistics

Threads
1,214,812
Messages
6,121,704
Members
449,048
Latest member
81jamesacct

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top