+ Reply to Thread
Results 1 to 13 of 13

Is there any other formula I can use rather than lookup which slows excel

  1. #1
    Registered User
    Join Date
    03-30-2015
    Location
    Burgersfort South Africa
    MS-Off Ver
    office 2007
    Posts
    7

    Is there any other formula I can use rather than lookup which slows excel

    Example:
    In column c7 I enter a code for example 451, in column do I have the formula =if (c7=0,"",Lookup(c7,x6:y540))
    Which looks up the name and returns it to do. I have many of these formula ando it slows excel down very badly, I have tried match and index but they return #NO
    and #VALUE. What alternative formula can I use so as not to slow excel down?

  2. #2
    Valued Forum Contributor
    Join Date
    04-12-2012
    Location
    India
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, 2019, Office 365, Google Spreadhsheet
    Posts
    640

    Re: Is there any other formula I can use rather than lookup which slows excel

    Hi There...Just need small clarity..Do you have data lying in range X6:y540? If Yes, then what kind of is lying in Column X? (I am assuming it might have the codes there)...Also, if possible please upload you file for clear understanding with expected result.
    Thanks,
    Anil Dhawan


    Click *Add Reputation to say "Thanks" and don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved) if you are satisfied.

    Don't stop when you are tired. STOP when you are done!

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

    Re: Is there any other formula I can use rather than lookup which slows excel

    Post your file. Your description doesn't look correct to me.
    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.

  4. #4
    Registered User
    Join Date
    03-30-2015
    Location
    Burgersfort South Africa
    MS-Off Ver
    office 2007
    Posts
    7

    Re: Is there any other formula I can use rather than lookup which slows excel

    Please check if you have received the attachment. Yes there is the code in X and the text in Y and the price in Z
    Attached Files Attached Files

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

    Re: Is there any other formula I can use rather than lookup which slows excel

    This may not speed things up but use VLOOKUp instead

    in C6
    =IF($B6=0,"",VLOOKUP($B6,$S$7:$V$150,COLUMN()-1,FALSE))
    copy across to E6

    in P6
    =IF($B6=0,"",VLOOKUP($B6,$S$7:$V$150,COLUMN()-13,FALSE))
    and copy down

  6. #6
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,850

    Re: Is there any other formula I can use rather than lookup which slows excel

    One of the key principles that I see in attempting to speed up a spreadsheet is find and eliminate duplicated effort. Lookups in particular (whether done with the LOOKUP() or MATCH() or VLOOKUP() function) are processor intensive, so speeding a spreadsheet up often involves reducing the number of lookups.

    I notice that, as currently structured, your spreadsheet is performing 4 lookups in each row -- basically the same lookup each time (where is [#incolumn2] in the lookup table). My first thought to speed this up is how to reduce these 4 lookups down to 1 lookup. I know you said that you tried the MATCH and INDEX(), but I am guessing that you kept them nested together as a group as we almost always do. In order to speed this up, I would still use MATCH() and INDEX(), but I would separate the two functions so that the MATCH() function is in a helper column (maybe column R or other column). This helper column performs the lookup once per row, and the function might look something like =MATCH(B6,$T$7:$T$100,1). Then, replace your existing lookup functions in column C, D, E, P with the something like =IINDEX($U$7:$U$100,$R6) (where R6 contains the MATCH() function).

    I expanded your spreadsheet to 7000+ rows to test this. The original arrangement took about 5 seconds to calculate. This arrangement was near instantaneous.
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

  7. #7
    Forum Contributor
    Join Date
    12-02-2014
    Location
    England
    MS-Off Ver
    2010 | 2016
    Posts
    167

    Re: Is there any other formula I can use rather than lookup which slows excel

    For Ingredients : =INDEX(T7:T39,MATCH(B6,S7:S39,0))
    For Unit Cost : =INDEX(U7:U39,MATCH(C6,T7:T39,0))
    For UOM :=INDEX(V7:V39,MATCH(C6,T7:T39,0))

    Those 3 formulas draw information out from the right hand side.

    Not sure what else you're looking at, but if you need to lookup 7000 files, you need VBA not formulas.

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Is there any other formula I can use rather than lookup which slows excel

    Quote Originally Posted by MrShorty View Post
    so speeding a spreadsheet up often involves reducing the number of lookups.

    I notice that, as currently structured, your spreadsheet is performing 4 lookups in each row -- basically the same lookup each time (where is [#incolumn2] in the lookup table). My first thought to speed this up is how to reduce these 4 lookups down to 1 lookup. I know you said that you tried the MATCH and INDEX(), but I am guessing that you kept them nested together as a group as we almost always do. In order to speed this up, I would still use MATCH() and INDEX(), but I would separate the two functions so that the MATCH() function is in a helper column (maybe column R or other column). This helper column performs the lookup once per row, and the function might look something like =MATCH(B6,$T$7:$T$100,1). Then, replace your existing lookup functions in column C, D, E, P with the something like =IINDEX($U$7:$U$100,$R6) (where R6 contains the MATCH() function).
    +1, very good advice.

    I also notice that you literally duplicated the same lookup twice.
    You have this exact same formula in BOTH D6 and P6.
    =IF(B6=0,"",LOOKUP(B6,S7:U50))
    That's making excel do exactly the same work twice.

    So in P6 you could just put
    =D6
    or Vice versa.

  9. #9
    Registered User
    Join Date
    03-30-2015
    Location
    Burgersfort South Africa
    MS-Off Ver
    office 2007
    Posts
    7

    Re: Is there any other formula I can use rather than lookup which slows excel

    Have tried your match and index formula but I get #N/A in R6 and #VALUE! in C6 when I do, what am I doing wrong?

  10. #10
    Registered User
    Join Date
    03-30-2015
    Location
    Burgersfort South Africa
    MS-Off Ver
    office 2007
    Posts
    7

    Re: Is there any other formula I can use rather than lookup which slows excel

    Absolutely fantastic!! tried one, works perfectly, will drag through and see if it speeds up the work sheets.

  11. #11
    Forum Contributor
    Join Date
    12-02-2014
    Location
    England
    MS-Off Ver
    2010 | 2016
    Posts
    167

    Re: Is there any other formula I can use rather than lookup which slows excel

    Not sure if you are talking to me, if so, I have tried attaching the file as I've edited it, however the file uploader on this site is easily the worst I've ever used.

    I've uploaded it here instead, hope it works.

    http://s000.tinyupload.com/index.php...20941000261769

    If it doesn't let me know.

    Cheers,

    EDIT****

    I've forgotten to Absolutely Address the ranges in my formulas, if you highlight the ranges (E1:E40) for example and press F4, it will hold the ranges in place for your data table, meaning that when you drag the formulas down, the table range won't adjust with it.
    Last edited by HarryGreenwood; 04-10-2015 at 06:12 AM. Reason: Missed something

  12. #12
    Registered User
    Join Date
    03-30-2015
    Location
    Burgersfort South Africa
    MS-Off Ver
    office 2007
    Posts
    7

    Re: Is there any other formula I can use rather than lookup which slows excel

    Hi Harry,
    Have changed all lookup formulas to the index and match formula that I did receive, thank you very much, however the response time for calculation is still running at around 4 seconds, any other idea's you may have to help will be much appreciated.

    Regards

    Craig

  13. #13
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,260

    Re: Is there any other formula I can use rather than lookup which slows excel

    Here is your example with MrShorty's suggestions implemented.
    Attached Files Attached Files
    Remember what the dormouse said
    Feed your head

+ 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. Replies: 3
    Last Post: 03-20-2014, 06:03 PM
  2. Array formula slows the file considerably
    By Aland2929 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-23-2013, 03:59 AM
  3. [SOLVED] Excel worksheet slows computer
    By stevieray in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-02-2006, 09:10 PM
  4. Replies: 1
    Last Post: 03-21-2006, 07:30 PM
  5. Excel slows down for no(?) reason...
    By thekovinc in forum Excel General
    Replies: 0
    Last Post: 12-06-2005, 02:01 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