+ Reply to Thread
Results 1 to 7 of 7

Need a forumla to take 3 factors to find a solution from a table

  1. #1
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Need a forumla to take 3 factors to find a solution from a table

    Hi everyone

    After the very helpful thread that I recently wrote, I need help with the last stage of my Excel file - thanks to anyone who tries and/or can help!

    I have attached the file; now that my file tells me, from the initial three columns, which band the price falls into, I just need the cost box to:

    - take note of the gpm (above) - telling it which of the two tables to go to in the 'tariff' sheet
    - take note of the volume - telling it which row to go to in the 'tariff' sheet
    - take note of the band - telling it which column to go to in the 'tariff' sheet

    All of which should then bring it to a price!

    I've tried by am really struggling - any help would be greatly appreciated.

    Thanks, Warren
    Attached Files Attached Files
    Last edited by warren_richards04; 04-16-2010 at 08:03 AM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need a forumla to take 3 factors to find a solution from a table

    Based purely on your sample file:

    F7: =INDEX(tariff!$B$5:$G$28,MATCH($B$4,tariff!$A$5:$A$14,0)+14*($B$3="20-40"),MATCH("* "&TRIM($E7),tariff!$4:$4,0))
    copied down

  3. #3
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Need a forumla to take 3 factors to find a solution from a table

    Thanks a lot.

    I will try this, but how easy do you think it might be to explain this, as I need to extend it to a wider sample and wonder whether I can learn the logic behind it?

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need a forumla to take 3 factors to find a solution from a table

    The example is quite specific I grant you and actually contains an error...

    please replace tariff!$4:$4 with tariff!$B$4:$G$4

    In reality it assumes the tariff tables are identical and that from each "Duration" cell there are 14 cells before the next "Duration" cell.

    With the above assumptions accounted for it matches the Volume against the values in Col A on the first tariff table to determine row_index position of result - to which it adds 14 if looking at the 2nd table.
    It subsequently matches the Band against the headers of the first tariff table to determine column_index.
    The intersect of row_index & column_index within specified range is the value of interest.

    If the tariff tables are not all identical then the above would need to be revised. Others may suggest naming your tables and using INDIRECT etc...

  5. #5
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Need a forumla to take 3 factors to find a solution from a table

    Thanks - this is very helpful.

    I have tried doing this in my master file, but it doesn't seem to work... the formula stays but it says N/A as the result.

    Here is the formula:

    =INDEX(Tariff!B5:Tariff!G70,MATCH(B4,Tariff!B5:B14,0)+14*(B3="20-35")+28*(B3="35-60")+42*(B3="60-80")+56*(B3="80-100"),MATCH("* "&TRIM($E7),Tariff!B4:F4,0))

    Any idea what I have done wrong? I've added in 28, 42 etc. for the new tables and options.

    Thanks in advance

  6. #6
    Registered User
    Join Date
    04-15-2010
    Location
    London, England
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Need a forumla to take 3 factors to find a solution from a table

    Panic over - I have found it! I have the wrong parameters to match the index running down the side.

    You are a genius, thank you so much - this is amazing.

  7. #7
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Need a forumla to take 3 factors to find a solution from a table

    If you have lots of tariffs I confess I'd dispense with the IF - I used that based on 2 table example


    MATCH($B$4,Tariff!$B$5:$B$14,0)+14*($B$3="20-35")+28*($B$3="35-60")+42*($B$3="60-80")+56*($B$3="80-100")

    becomes

    MATCH($B$4,Tariff!$B$5:$B$14,0)+14*(MATCH($B$3,{"0-20","20-35","35-60","60-80","80-100"})-1)

    or

    MATCH($B$4,Tariff!$B$5:$B$14,0)+LOOKUP($B$3,{"0-20","20-35","35-60","60-80","80-100"},{0,14,28,42,56})

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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