+ Reply to Thread
Results 1 to 8 of 8

[SOLVED] Streamlining an array formula (calendar)

  1. #1
    Registered User
    Join Date
    09-18-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    9

    [SOLVED] Streamlining an array formula (calendar)

    Hiya,

    I have a calendar that is functioning in the way I want it to but I am looking to streamline it so that it takes less time to load and crashes less. I've attempted to do this by making my data a named table and only including the table in the formula instead of counting all the blank cells in the column but for some reason this has just pushed the date forward a day and I can't for the life of me figure out why.

    In the attached file, you can see the working formula on the Events Calendar View sheet in cells E6 - G6 and my attemped amended formula in B6 - D6. I'm guessing that it shifts the date one day because it's now not taking into account the header row, which moves everything along one place (or something like that?), but I just can't figure out how to get around it.

    Can anyone figure out why this is happening or help me to streamline my original formula in some other way?

    Thanks!
    Last edited by Tigerlilygem; 10-08-2018 at 04:19 AM.

  2. #2
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: Streamlining an array formula (calendar)

    Wow! That is slow - I inserted a column in your data table and it took minutes to give control back to me, I then put a formula in that column, and again it took minutes, so it will take me too long to revise all the formulae.

    I would suggest that you work with proper dates (as Excel recognises them), because you can easily format them to show only days, or long-form months, and you can use the TEXT function to do this. Generally, in my calendars I use a helper column in the Events sheet which combines the date with a unique sequential number derived from the date, so that multiple occurrences on the same date can easily be identified. There is no need, then, for array formulae in the Calendar sheet, as a simple INDEX/MATCH formula can display the relevant information. Here's a thread where I posted a calendar file yesterday (in Post #7, although there are references to two others in earlier posts):

    https://www.excelforum.com/excel-for...end-dates.html

    This displays a monthly calendar of events, where the month and year can be selected from drop-downs. It can display up to 10 events per day in groups of 10, i.e. 1-10, 11-20 etc., so in effect it can cope with up to 100 events per day. You can decide to display one of three fields of data, or all of them, and for events covering several days (or months) you can just set a start and end date range in the Data tab, and this will be expanded automatically. It responds immediately to any changes as it is purely formula-driven, and is very fast,

    Take a look at that and see if you can pick up some ideas on how to improve the performance of your workbook.

    Hope this helps.

    Pete

  3. #3
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: Streamlining an array formula (calendar)

    Thanks for the rep.

    Presumably you found something of interest in those files?

    Pete

  4. #4
    Registered User
    Join Date
    09-18-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    9

    Re: [SOLVED] Streamlining an array formula (calendar)

    Hi Pete,

    Looks like my last comment didn't post. Thanks very much for your help - definitely useful - I'm taking some ideas to vastly improve my calendar!

  5. #5
    Registered User
    Join Date
    09-18-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    9

    Re: [SOLVED] Streamlining an array formula (calendar)

    Hi Pete - I wonder if you can help me with editing a formula of yours?

    In the attached, on 'Public Calendar View' in cell B11 (and B17, B23, B29), I've edited a formula that's returning the wrong value. (I've added the "No Event" comment just so it's easier to see - I'll delete this after.) For A11='Data View'!E:E it's returning a date reference that's incorrect each time (I've noted how incorrect in column I) and I can't figure out why.

    Are you able to help?

  6. #6
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: [SOLVED] Streamlining an array formula (calendar)

    Well, the formula that you had is an array formula, as you are looking at two different columns in the Data View sheet to look for matches (and using full-column references, which is a NO-NO for array formulae). If you really want to, you can do CTRL-SHIFT-ENTER on that cell (i.e. B11), and after a short delay you will get the result Ice Rink.

    However, this approach is going to slow things down, so you can make better use of the helper column in the Data View sheet to improve things. Change the formula in E2 of the Data View sheet to this:

    =EventData1[[#This Row],[Date]]&"_"&EventData1[[#This Row],[Ref]]&IF(EventData1[[#This Row],[Public/Private]]="Public","_P","")

    You can see that it adds a "_P" to the end of the of the result if you have Public in column P. Then in B11 of the Public Calendar sheet, the formula becomes:

    =IFERROR(INDEX('Data View'!$F:$F,MATCH(B$10&"_"&$A11&"_P",'Data View'!$E:$E,0)),"No event")

    Note that I've removed the sheet references, as you don't need them if the formula refers to the same sheet. This will be a lot faster than the array formula. If you want to have an "Admin Calendar View" sheet, where all events are listed, then you would replace the &"_P" shown in red above with &"*", which means "any (or no) characters" after the date_number part.

    Hope this helps.

    Pete

  7. #7
    Registered User
    Join Date
    09-18-2018
    Location
    UK
    MS-Off Ver
    2010
    Posts
    9

    Re: [SOLVED] Streamlining an array formula (calendar)

    I see! I was trying not to use full column references but for some reason I kept encountering incorrect values when I tried it so I gave up.

    This makes a lot of sense - think I've learnt a lot from this one thread, so thanks!

  8. #8
    Forum Guru Pete_UK's Avatar
    Join Date
    12-31-2011
    Location
    Warrington, England
    MS-Off Ver
    Office 2019 (still learning)
    Posts
    24,714

    Re: [SOLVED] Streamlining an array formula (calendar)

    You're welcome - come back any time.

    Pete

+ 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] Streamlining multiple IF(AND's in a formula
    By ScotsWahey in forum Excel Formulas & Functions
    Replies: 21
    Last Post: 11-17-2016, 02:22 PM
  2. Streamlining a formula
    By c.drysdale89 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 05-10-2012, 04:49 AM
  3. Streamlining settings...by array?
    By beeawwb in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2008, 07:00 PM
  4. Calendar Worsheets - Streamlining...
    By bmasella in forum Excel General
    Replies: 4
    Last Post: 04-16-2007, 11:07 AM
  5. Streamlining a long IF=(AND formula ??
    By David.Allen297 in forum Excel General
    Replies: 2
    Last Post: 10-05-2005, 08:05 AM
  6. Array Formula Calendar
    By [email protected] in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 09-28-2005, 06:05 AM
  7. Calendar Array-formula
    By [email protected] in forum Excel Formulas & Functions
    Replies: 17
    Last Post: 09-21-2005, 07:05 AM

Tags for this Thread

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