XLOOKUP & LOOKUP formula

buh149

New Member
Joined
Jun 21, 2022
Messages
6
Office Version
  1. 365
Platform
  1. Windows
Hi all,
I have a formula which works, but I feel could be made more simple - see cell H13 (image attached - sorry, the xl2bb addin doesn't work for me!).

Named ranges:
MIN = cells C5:C8
MAX = cells D5:D8
AD = cells E5:E8
IN: cells F5:F8
BR: cells G5:G8

I feel that I could remove the "IF" part of these formulas and surely replace with an XLOOKUP or something else? E.g. in the case of the formula in cell H13, where it tells you which column to take the % fee from based on the value in column C ("AD", "IN", or "BR"). The LOOKUP part of the formula works fine but I just think there must be a better way to say "if the value in column C is X, then take it from column A", etc, at the same time using the LOOKUP formula to take from the correct row based on column D. Maybe I've been looking at it too long and am missing something very obvious.

Figures have been changed and made up to keep things simple and anonymous.

Thanks to anyone that can help!
 

Attachments

  • Screenshot 2022-08-04 123420.jpg
    Screenshot 2022-08-04 123420.jpg
    158 KB · Views: 8

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Myabe
Excel Formula:
=LOOKUP(2,1/((D13>=MIN)*(D13<=MAX)),INDEX(E5:G8,,MATCH(C13,E4:G4,0)))
 
Upvote 0
Solution
Thank you!! This works! Much easier to read. I just amended one small error which was the D13>=MIN which was changed to D13>MIN, but otherwise this is great. Much appreciated :)
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,215,054
Messages
6,122,893
Members
449,097
Latest member
dbomb1414

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