+ Reply to Thread
Results 1 to 4 of 4

A faster way to make a long formula work to cut down on calculations?

  1. #1
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    A faster way to make a long formula work to cut down on calculations?

    I have this formula that I wrote years ago that does a counting process. It is so big though and is used for 4 columns and 3051 rows, on 12 different sheets. It makes my book over 800mb and although it does calculate fine, it takes forever to open, link, and update. All it does is it checks the data in say row 3050 against row 3051 and if it's smaller or larger, will give a result of 1. If row 3050 and 3051 is the same, it will check row 3050 against row 3051 and row 3052 and will do so repeatedly until it finds a smaller or larger value. This formula will check if say 3050 is greater than say 3051 and so on. I also have one that does the same thing except it checks for if 3050 is less than 3051.

    There has to be a better way to achieve this that will cut down on the size of the book, make it run cleaner and faster. Is there a better way than what I have come up with?

    This is the formula:

    =IF(Link!B2="?","",IF(Link!B2>Link!B3,1,IF(AND(Link!B2=Link!B3,Link!B2>Link!B4),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2>Link!B5),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2>Link!B6),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2>Link!B7),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2>Link!B8),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2>Link!B9),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2>Link!B10),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2=Link!B10,Link!B2>Link!B11),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2=Link!B10,Link!B2=Link!B11,Link!B2>Link!B12),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2=Link!B10,Link!B2=Link!B11,Link!B2=Link!B12,Link!B2>Link!B13),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2=Link!B10,Link!B2=Link!B11,Link!B2=Link!B12,Link!B2=Link!B13,Link!B2>Link!B14),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2=Link!B10,Link!B2=Link!B11,Link!B2=Link!B12,Link!B2=Link!B13,Link!B2=Link!B14,Link!B2>Link!B15),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2=Link!B10,Link!B2=Link!B11,Link!B2=Link!B12,Link!B2=Link!B13,Link!B2=Link!B14,Link!B2=Link!B15,Link!B2>Link!B16),1,IF(AND(Link!B2=Link!B3,Link!B2=Link!B4,Link!B2=Link!B5,Link!B2=Link!B6,Link!B2=Link!B7,Link!B2=Link!B8,Link!B2=Link!B9,Link!B2=Link!B10,Link!B2=Link!B11,Link!B2=Link!B12,Link!B2=Link!B13,Link!B2=Link!B14,Link!B2=Link!B15,Link!B2=Link!B16,Link!B2>Link!B17),1,""))))))))))))))))

    I really don't know what would be the best way to do this, and if it's something I need to post in the commercial services, that would be fine with me. I'd just really like to get this fixed so it will run faster.

    Thanks so much for looking at this!!!

  2. #2
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: A faster way to make a long formula work to cut down on calculations?

    Try this ...

    =IF(Link!B2="?","",IF(SUMPRODUCT(COUNTIF(OFFSET(Link!B2,,,ROW($1:$15),1),"<"&Link!B2)
    *(COUNTIF(OFFSET(Link!B2,,,ROW($1:$15),1),">"&Link!B2)=0))>0,1,""))

  3. #3
    Forum Contributor
    Join Date
    08-07-2012
    Location
    US
    MS-Off Ver
    Excel 2010
    Posts
    202

    Re: A faster way to make a long formula work to cut down on calculations?

    If you could see the smile on my face right now!!!!!!!!!!! That is absolutely amazing!!!!!!!!! I just can't thank you enough!!!! I'm just flabbergasted right now. Thank you thank you thank you!!!!!!!!!!! (I could fill this entire page up right now with !!!!!!!).

    Thank you so much seriously!!!! I hope you get everything that your heart desires in this life and the next!!!!!!! You're just awesome!!!!!!!!!!!!!!!!!!!

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,913

    Re: A faster way to make a long formula work to cut down on calculations?

    You're welcome!

+ 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. How to make Long FormulaArray macro to work? :(
    By Dahlia in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-12-2016, 08:50 PM
  2. [SOLVED] I have a Macro that takes a long time to run, how to make it faster
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 19
    Last Post: 01-22-2016, 09:29 AM
  3. Combo Box Autocomplete - Can't make it work for long list
    By ELapointe in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-25-2014, 12:30 AM
  4. Make the below code work faster!!!
    By devpp in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-04-2013, 06:13 AM
  5. Can anyone optimize the code? (to make it work faster)
    By olegai in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-23-2007, 07:50 AM
  6. Make Excel work faster
    By Siva in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-09-2006, 11:10 AM
  7. [SOLVED] Make Excel Work faster
    By Siva in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 04-07-2006, 05:35 AM

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