+ Reply to Thread
Results 1 to 3 of 3

Shorten very long vlookup formula

  1. #1
    Registered User
    Join Date
    12-29-2014
    Location
    Londonium
    MS-Off Ver
    MAC 2012
    Posts
    1

    Shorten very long vlookup formula

    I have a spreadsheet I use to calculate the salary cap for our fantasy hockey league and I use a very long VLOOKUP formula to calculate it, but it looks very ugly. Is there a way to shorten it, or use another Excel matrix formula (INDEX MATCH)?

    I am not 100% in and while the formula does the work it just is a bit too unwieldy so any help would be appreciated.

    This is what it looks like:

    =(((VLOOKUP($C3,Skater15,6,FALSE)*Result!$K$11)+(VLOOKUP($C3,Skater15,7,FALSE)*Result!$L$11)+((VLOOKUP($C3,Skater15,12,FALSE)+VLOOKUP($C3,Skater15,16,FALSE))*Result!$M$11)+(VLOOKUP($C3,Skater15,18,FALSE)*$N$11)+(VLOOKUP($C3,Skater15,22,FALSE)*Result!$O$11)+(VLOOKUP($C3,Skater15,23,FALSE)*Result!$P$11))*Result!$L$9)*(VLOOKUP($C3,Skater15,5,FALSE)/82)

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: Shorten very long vlookup formula

    Apart from removing non-essential brackets I doubt you'll make it much shorter as each item is independent and there doesn't seem to be any pattern.
    Looks like

    Having found C3 in Skater
    (Col6 * K11 + Col7 * L11 + (Col12+Col15) * M11 + Col18 * N11 + Col22 * O11 + Col23 * P11) * L9 * Col5 / 82

    Not much of a pattern there
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,078

    Re: Shorten very long vlookup formula

    New idea!

    Create a table 2 columns by 7 rows

    Please Login or Register  to view this content.
    Then something like

    =SUMPRODUCT(VLOOKUP($C3,Skater15,INDEX(Table!A1:B7,VLOOKUP(INDIRECT("1:"&ROW(COUNTA(Table!A1:A7))),1))*INDEX(Table!A1:B7,VLOOKUP(INDIRECT("1:"&ROW(COUNTA(Table!A1:A7))),2)))*L9 * VLOOKUP($C3,Skater15,9,FALSE)*$L$9/82

    This is based on this

    =SUMPRODUCT(--MID(H13,ROW(INDIRECT("1:" & LEN(H13))),1))

    which adds up the digits of a number using INDIRECT to generate a sequence of rows.
    Use that sequence to read down the table extracting the column number and cell to multiply against, SUMPRODUCT them as an array then multiply the L9 etc a the end of your formula as it doesnt fit the sequence.

    Here's a reference to the original problem:

    http://www.mrexcel.com/forum/excel-q...ml#post4257111

    I believe this should work though I haven't got time to develop it.

+ 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] formula too long, not sure how to shorten
    By Jane in forum Excel Formulas & Functions
    Replies: 22
    Last Post: 01-18-2016, 11:54 PM
  2. How to shorten too long rows
    By artner0112 in forum Excel General
    Replies: 4
    Last Post: 04-27-2015, 10:42 PM
  3. Long formula, need to shorten
    By BlairStevenson in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 07-06-2014, 12:23 PM
  4. [SOLVED] Too Long formula to shorten help
    By lapot in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 03-14-2014, 07:51 AM
  5. [SOLVED] Shorten a very long Formula
    By Floydlevedale in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2013, 09:39 AM
  6. [SOLVED] Shorten the long text
    By Solomon14all in forum Excel General
    Replies: 7
    Last Post: 09-15-2012, 05:43 PM
  7. shorten a long list
    By kamelkid2 in forum Excel General
    Replies: 2
    Last Post: 01-28-2011, 01:13 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