+ Reply to Thread
Results 1 to 4 of 4

matching error between column having every date and column having business days

  1. #1
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    matching error between column having every date and column having business days

    I've attached a worksheet which I've taken from a larger workbook, which is a trading strategy.

    The trading strategy formulas elsewhere in the workbook must use the dates in Column A (generally, business days) of the attached worksheet. However some of the data which goes into the calculations is obtained daily (Columns H and I).

    What we want to do is match the data in H and I to the dates in Column A as best we can. The results of this matching are in column M.

    The challenge to solve is that we're matching business days to data (in Column I) from every calendar day. The formula is meant to average out the extra data-days in column I and plug that into column M. So for example, if we have data for Saturday the 3rd, Sunday the 4th, and Monday the 5th, then we want column M to show the average of the 3rd:5th

    The existing formulas work for a time, however around row 830 they get out of sync, probably due to the fact that by that time, the # of business days is lagging further and further behind the # of calendar days.

    I've posted some notes in the attached worksheet to try to help any of you gurus who can take the time to look at this.

    I always appreciate your help. Thanks!
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,531

    Re: matching error between column having every date and column having business days

    If I understand then it would seem that the errors occur because the formulas in columns L and M are trying to get values from column I, based on dates in column H that do not exist.
    Since the data in column H ends at 4/15/16 (row 1209) the formula for L831 gets an #N/A error when attempting ...MATCH(K832-1,H:H,0)... as there is no 4/17/16 in column H.
    Similarly M832 returns the value of 45.50 as attempting to average the values between I1210 and I1212 (select M832 and run the evaluate formula feature) returns a division by zero error which is caught by the IFERROR function (this continues to the end of column M).
    Let us know if you have any questions.
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  3. #3
    Forum Contributor
    Join Date
    12-03-2008
    Location
    Key West, FL
    MS-Off Ver
    365 Apps for Enterprise
    Posts
    665

    Re: matching error between column having every date and column having business days

    Thanks Jete... you're right. Usually (in my other workbooks) column H is filled down to roughly the present day but in this case that data was missing and I didn't notice. Thanks for pointing that out!

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,531

    Re: matching error between column having every date and column having business days

    You're Welcome. Thank You for the feedback and for marking the thread as 'Solved'. I hope that you have a blessed day.

+ 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. Update date column with number of days in another column using vba
    By ajitexcel in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-16-2017, 05:49 AM
  2. Macro to change date as per business days and its format daily in a column
    By galbatrox9 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2016, 09:26 PM
  3. Replies: 3
    Last Post: 04-08-2016, 09:11 AM
  4. Replies: 4
    Last Post: 05-19-2014, 04:28 PM
  5. Add Date in Column A Plus Number of Days in Column B and show result in Column C
    By excelforumcrisis in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-12-2013, 02:01 PM
  6. [SOLVED] Search 1st Column for Date older than 5 days based on 2nd column contents
    By Nu2Java in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-31-2012, 10:49 PM
  7. Replies: 3
    Last Post: 08-22-2006, 04:20 PM

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