+ Reply to Thread
Results 1 to 5 of 5

Calculating Max and Minimum Dates from a Column Array

  1. #1
    Registered User
    Join Date
    02-26-2014
    Location
    Elanora
    MS-Off Ver
    365
    Posts
    4

    Calculating Max and Minimum Dates from a Column Array

    Hi there,

    I am trying to write a macro to lookup a reference code in column A (Worksheet 1), then find the min date in another worksheet (Worksheet 2) and return that value into a column in the original worksheet.

    I need to do the same for the max value as well. I have this working with array formulas manually, but performance is an issue as there are over 10,000 rows and the column array is column 12 - 91.

    An example:

    Worksheet 1

    Reference Code Min Date Max Date
    100.500.SP1 21/2/2016 13/3/2016


    Worksheet 2

    Reference Code Gate 1 Gate 2 Gate N...
    100.500.SP1 21/2/2016 22/2/2016 ....

    My current array formulas are:

    MIN
    =IF(MIN(IF('3 - Tagged_Item_Register_Export'!A:A=A2,'3 - Tagged_Item_Register_Export'!N:N))=0,"",MIN(IF('3 - Tagged_Item_Register_Export'!A:A=A2,'3 - Tagged_Item_Register_Export'!N:N)))

    MAX
    IF('3 - Tagged_Item_Register_Export'!A:A=A2,'3 - Tagged_Item_Register_Export'!AL:AL),IF('3 - Tagged_Item_Register_Export'!A:A=A2,'3 - Tagged_Item_Register_Export'!AP:AP),IF('3 - Tagged_Item_Register_Export'!A:A=A2,'3 - Tagged_Item_Register_Export'!AT:AT),IF('3 - Tagged_Item_Register_Export'!A:A=A2,'3 - Tagged_Item_Register_Export'!AX:AX)))

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2404 Win 11 Home 64 Bit
    Posts
    23,860

    Re: Calculating Max and Minimum Dates from a Column Array

    crossposted: http://www.mrexcel.com/forum/excel-q...umn-array.html

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,368

    Re: Calculating Max and Minimum Dates from a Column Array

    Performance WILL be an issue if you use full column ranges in an Array Formula, particularly if it is repeated 10,000 times.

    Either convert your data to a Structured Table and use Table references, or use Dynamic Named Ranges for each of the columns, or use a Worksheet Change event handler to apply the array formulae on an as required basis.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    02-26-2014
    Location
    Elanora
    MS-Off Ver
    365
    Posts
    4

    Re: Calculating Max and Minimum Dates from a Column Array

    @alansidman
    Apologies. Won't happen again.

    @TMS
    Thanks for the tips. I'll use the dynamic named range idea

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,368

    Re: Calculating Max and Minimum Dates from a Column Array

    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. [SOLVED] Extract Minimum and maximum dates against values in adjucent column
    By mchilapur in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-06-2015, 01:35 AM
  2. [SOLVED] return of row and column header for a minimum value af an array
    By keuninkske in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 02-15-2013, 04:09 AM
  3. return of row and column header for a minimum value af an array
    By keuninkske in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-14-2013, 06:47 PM
  4. Replies: 0
    Last Post: 10-02-2012, 02:21 AM
  5. Replies: 3
    Last Post: 03-18-2011, 11:28 AM
  6. Sorting Dates Column and calculating MTD, YTD
    By Pasha81 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 11-10-2009, 09:10 AM
  7. [SOLVED] calculating the minimum value ignoring o
    By Aladin Akyurek in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 06:05 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