+ Reply to Thread
Results 1 to 4 of 4

Excel values based on consecutive dates

  1. #1
    Registered User
    Join Date
    11-01-2010
    Location
    CapeTown
    MS-Off Ver
    Excel 2010
    Posts
    42

    Excel values based on consecutive dates

    I am trying to calculate values based on consecutive dates dates. The dates are ordered in the list.

    I am including a Excel 2010 file to demonstrate. I have the dates in column A, and want to calculate the values in column B.



    Regards
    Attached Files Attached Files

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

    Re: Excel values based on consecutive dates

    You can use this formula in B2:

    =IF(A2="","",IF(COUNTIF(A$2:A2,A2)=1,MAX(B$1:B1)+1,B1))

    then copy down to the bottom of your list of dates.

    Hope this helps.

    Pete

  3. #3
    Registered User
    Join Date
    11-01-2010
    Location
    CapeTown
    MS-Off Ver
    Excel 2010
    Posts
    42

    Re: Excel values based on consecutive dates

    Hi Pete, thank you perfect.

    What if I have different years? I've tried adapting you formula, but I have no success.


    Regards
    Attached Files Attached Files

  4. #4
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 365 version 2501
    Posts
    18,946

    Re: Excel values based on consecutive dates

    The following formula yields the same values as those manually placed in column C:
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    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.

+ 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. VBA Wide to Long Table by Dates for consecutive constant values
    By RedSummer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-02-2018, 03:46 PM
  2. Adding consecutive dates in Excel 2010 using VBA
    By kerrymeister in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2016, 07:45 AM
  3. [SOLVED] Enter dates in one column based on whether dates are consecutive in another column
    By ktbb0312 in forum Excel Formulas & Functions
    Replies: 14
    Last Post: 12-17-2015, 02:03 PM
  4. Replies: 0
    Last Post: 06-04-2014, 10:08 AM
  5. [SOLVED] Count consecutive values based on multiple conditions
    By munchkin in forum Excel Formulas & Functions
    Replies: 11
    Last Post: 10-15-2013, 05:59 AM
  6. Highlighting consecutive cells based on values
    By thelegazy in forum Excel General
    Replies: 2
    Last Post: 07-22-2013, 05:24 PM
  7. Replies: 3
    Last Post: 02-14-2012, 01:38 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