Find first hit in fact table via lookup in priority table

Skovgaard

Board Regular
Joined
Oct 18, 2013
Messages
197
Office Version
  1. 365
Platform
  1. Windows
Hi Experts,

I'm seeking some inspiration to a project I'm doing.
On the link at the bottom, I've created a sample file, so I better can explain my challenge.

I'm building a customer quotation tool. The end-user should be able to just put in a customer- and item number (marked with green cells).
In the yellow cells, a rebate should automatically be found in the table "fRebates".

In the table "tRebateModel" criteria's and priorities are stored and used for finding correct rebate.
E.g. Priority 1 says "CUNO" and "ITNO". It should then run through the rebate table, to se if there is a hit on Customer- and Item Number and then return the rebate. If there is no hit, then it should check if there is a hit on priority 2 and so on, all the way to priority 10.

My own thoughts, if possible:
- It would be nice if it automatically could find the needed fields, in case the criteria's in the rebate model will change. I'm thinking it might be possible with naming cells and use INDIRECT()
- A "smooth" solution would be preferable, instead of a lot of IFERROR(), which I think should be able to do the trick, in worst case.

Hoping someone can help with a solution, or point in a direction to make a smooth solution.

https://wetransfer.com/downloads/0b1ab6412c4ddbb0efed31d71f2acc1c20220928091620/e9fcfbdfa3b0ef3981238b74e0063a8520220928091620/330570

/Skovgaard


1664360615538.png
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Forum statistics

Threads
1,215,575
Messages
6,125,629
Members
449,241
Latest member
NoniJ

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