Forum Discussion

Charli2325's avatar
Charli2325
Copper Contributor
Dec 18, 2024

Help Excel

Hello,

Here is my problem:

 

I have a list of price (attached in the message).

 

And then a list of customers to invoice. For each customers, I have the Code they belong to and then a number of user which may vary from one customer to another.

Which formula could I use to search for the Price depending on the Code and then the range of Users please?

 

Thank you in advance for your help,

  • m_tarler's avatar
    m_tarler
    Steel Contributor

    Here is a formula that works.  It is based on TABLES but can be replaced with ranges if needed.  This does assume the # Users doesn't exceed 99 because it takes the 1st two characters of that column so the single digit has a space but if the # customers in that column goes above 99 then you need 3 digits and will have to adjust that formula.

    =VLOOKUP([@['# Users]],FILTER(HSTACK(--LEFT(PriceTable['# Users],2),PriceTable[Price]), (PriceTable[Code]=[@code])),2)

     

     

Resources