+ Reply to Thread
Results 1 to 15 of 15

Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

  1. #1
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    All,

    I have an ordered range of dates in cells A1-A11:

    9/6/2017
    9/19/2017
    10/3/2017
    10/17/2017
    10/25/2017
    11/14/2017
    11/28/2017
    12/14/2017
    3/1/2018
    6/19/2018
    7/3/2018
    7/17/2018

    In column B, I want to "mark" every row that is 40 or more days from the last "marked" row. Note that the first date (first row) should always be "marked" in cell B1. The mark that I prefer is to enter 0 (zero) in the corresponding cell in column B. All other cells in column B should remain blank. I'm looking for one formula that I can copy down column B that will provide the desired result (see below):


    9/6/2017 0
    9/19/2017
    10/3/2017
    10/17/2017 0
    10/25/2017
    11/14/2017
    11/28/2017 0
    12/14/2017
    3/1/2018 0
    6/19/2018 0
    7/3/2018
    7/17/2018

    I look forward to your answers! Thanks so much!

    JayUSA
    Last edited by JayUSA; 03-20-2018 at 11:16 PM. Reason: Corrected data

  2. #2
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Use a formula and the the DAYS360() function that calculates the number of days between two dates.
    Depending on which date you place first it's either + or -
    Check the Syntax in the Formula itself, just type = DAYS360( and the fx button in the formula bar

    You then can make it an IF statement to show something or conditional formatting to mark that cell and not need an extra column
    Last edited by Keebellah; 03-18-2018 at 05:54 PM. Reason: incomplete
    ---
    Hans
    "IT" Always crosses your path!
    May the (vba) code be with you... if it isn't; start debugging!
    If you like my answer, Click the * below to say thank-you

  3. #3
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Actually, I want column B to be formatted as described with the blanks and zeros. I'm using column B as a data series in a scatter plot. When charted, column B produces a series of custom tick marks along the x-axis below every scatter point that is 40 or more days after the previous scatter point with a custom tick mark.

    Regarding your proposal to use the DAYS function, can you explain how that can be used to create a single formula that I can copy down column B?

    Thanks very very much!

    JayUSA

  4. #4
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Something like this

    Please Login or Register  to view this content.
    Or this

    Please Login or Register  to view this content.
    You'll have to check the syntax and so, but I'm sure you can solve it.

    Then just double-click the right bottom corner of that cell and formula gets copied all the way down to the last filled row

  5. #5
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Thanks, Keebellah, but I don't see how this formula addresses my question.

    My question has nothing to do with the current date (i.e. the DATE function). I need a formula that reviews other/higher cells in column B, and inserts a zero if the last cell in column B that has a zero "marker" was more than 40 days earlier (per column A).

    Thanks.

  6. #6
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    A
    B
    C
    1
    2
    9/6/2017
    0
    B2: Input
    3
    9/19/2017
    B3: =IF(INT((A3 - A$2)/40) > INT((A2 - A$2)/40), 0, "")
    4
    10/3/2017
    5
    10/17/2017
    0
    6
    10/25/2017
    7
    11/14/2017
    8
    11/28/2017
    0
    9
    12/14/2017
    10
    3/1/2018
    0
    11
    6/19/2018
    0
    12
    7/3/2018
    13
    7/17/2018
    Entia non sunt multiplicanda sine necessitate

  7. #7
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Thanks, shg! That works perfectly!

    Thanks again to everyone!

    JayUSA

  8. #8
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Sorry, I misunderstood your question.
    But... you've got the answer.

  9. #9
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    shg,

    I'm getting some undesired/incorrect results using the the formula you supplied.

    I put your template into a worksheet (attached). Can you take a look?

    Thanks!

    JayUSA
    Attached Files Attached Files

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

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Or try this in B3:

    =IF(A3-LOOKUP(1,$B$2:B2,$A$2:A2)>=$F$1,0,"")

  11. #11
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Thanks, Phuocam!! Works perfectly!

    And thanks again to shg and others who moved the ball forward!!

  12. #12
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Phuocam,

    I have a quick follow-up question:

    Can you tell me what the number 1 does in your formula? Why aren't you looking for a value of 0 (zero)?

    Thanks,

    JayUSA

  13. #13
    Forum Expert Keebellah's Avatar
    Join Date
    01-12-2014
    Location
    The Netherlands
    MS-Off Ver
    Office 2021 (Windows)
    Posts
    7,905

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    My guess is , if you look at the parameters you're allowed to pass that a 1 can stand for TRUE of a the actual value 1

  14. #14
    Forum Contributor
    Join Date
    04-26-2009
    Location
    Austin, TX
    MS-Off Ver
    Excel 2016
    Posts
    241

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    All,

    Is there a way to revise Phuocam's formula (or anyone else's formula) so that it counts up the "marked" dates.

    Here's what I mean:

    9/6/2017 0
    9/19/2017
    10/3/2017
    10/17/2017 1
    10/25/2017
    11/14/2017
    11/28/2017 2
    12/14/2017
    3/1/2018 3
    6/19/2018 4
    7/3/2018
    7/17/2018

    That would be very helpful! Thanks,

    JayUSA

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

    Re: Enter zero in Col B where date in Col A is 40+ days from last row with zero in Col B

    Edit:

    =IF(A3-LOOKUP(10^35,$B$2:B2,$A$2:A2)>=$E$1,MAX($B$2:B2)+1,"")

+ 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] If cell meets date requirement enter 1, if not enter 0, if blank don't enter anything.
    By billrogers184 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-11-2017, 02:04 PM
  2. Replies: 5
    Last Post: 02-10-2016, 07:20 PM
  3. counting days until I enter end date
    By luckymsl in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 02-10-2016, 06:58 AM
  4. Calculate End Date Using Start Date and No. of Days excluding specific days.
    By SinusxCosinusx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-22-2013, 05:48 AM
  5. Changing Cell Colour set days before a date and set days after a date.
    By imranrasool in forum Excel Formulas & Functions
    Replies: 24
    Last Post: 04-26-2013, 03:40 AM
  6. excel formula: days remaining=end date-todays date+extention days
    By fsprings in forum Excel Formulas & Functions
    Replies: 13
    Last Post: 01-04-2013, 06:45 AM
  7. Formula to add days in enter date & get pop up when it due.
    By hdevadiga in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-24-2008, 10:48 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