+ Reply to Thread
Results 1 to 3 of 3

Returning a value based on 3 variables, one of which requires looking between a range

  1. #1
    Registered User
    Join Date
    12-01-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    1

    Returning a value based on 3 variables, one of which requires looking between a range

    Hi Guys,

    First time posting - usually i find the answers to all my excel queries on here from previous posts, but this one seems to be evading me!

    I've got a complicated Agent fee structure agreement which I've inherited. At the minute the team work through and manually check that each fee entered manually by the sales guys is in line with the agreed fee structure of each agent. Hundreds of agents each with their own structure

    Agent From To Type Fee
    Agent 1 1 115000 buying £375
    Agent 1 115001 200000 buying £405
    Agent 1 200001 350000 buying £455
    Agent 1 350001 500000 buying £505
    Agent 1 500001 750000 buying £705
    Agent 1 750000 9999999 buying £705
    Agent 1 1 115000 selling £375
    Agent 1 115001 200000 selling £405
    Agent 1 200001 350000 selling £455
    Agent 1 350001 500000 selling £505
    Agent 1 500001 750000 selling £705


    Agent 1's fee structure is above as an example. so if the price is between £115,001 and £200,000, they are buying and they are agent 1 the fee should be 405.

    I usually make a unique reference field i.e. Agent1&buying&Price and then vlookup into the fee structure, but because the price is between various different range values i'm struggling to automate.

    Any help greatly appreciated!!

    Eoghan

  2. #2
    Forum Contributor
    Join Date
    01-04-2013
    Location
    Tampa, Florida
    MS-Off Ver
    Excel 2013
    Posts
    142

    Re: Returning a value based on 3 variables, one of which requires looking between a range

    You could do an INDEX/MATCH formula entered as an array. Something along the lines of:

    =INDEX(FeeStructureTable,MATCH(1,(AgentColumn="Agent 1")*(TypeColumn="Buying")*(ToColumn>Price),0),5)

    Your To column would need to be sorted from lowest to highest

    This would need to be entered as an array formula Ctr+SHFT+Enter
    Last edited by mo4391; 12-02-2016 at 11:33 AM.

  3. #3
    Forum Contributor
    Join Date
    10-30-2014
    Location
    England
    MS-Off Ver
    2007 / 365
    Posts
    281

    Re: Returning a value based on 3 variables, one of which requires looking between a range

    So long as there are no overlaps in the From/To price ranges, you could put all 4 criteria (Agent, Type, <=Price, >=Price) in a SUMIFS function.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Need to create list based on name, range, and other variables
    By dlevisay in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 06-02-2015, 12:20 AM
  2. [SOLVED] Excel VBA range based on variables.
    By rybussell in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2013, 10:31 AM
  3. [SOLVED] Setting a range based on variables
    By DFrank231 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 02-22-2013, 04:23 PM
  4. [SOLVED] Range based on two variables
    By kinseld5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-20-2012, 12:19 PM
  5. How to Set Sort Range based on Variables ??
    By Orada in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-25-2011, 02:00 PM
  6. How to select/unselect range based on variables
    By kirba in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-11-2009, 04:00 AM
  7. Help! Sum of a range based on two variables
    By sequence19 in forum Excel General
    Replies: 2
    Last Post: 06-18-2009, 01:39 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1