+ Reply to Thread
Results 1 to 6 of 6

How to enter date associated with last number greater than zero or last zero in row

  1. #1
    Forum Contributor
    Join Date
    05-08-2015
    Location
    Asheville NC
    MS-Off Ver
    Excel for Office 365 MSO
    Posts
    111

    How to enter date associated with last number greater than zero or last zero in row

    I am trying to determine when a product ends by evaluating either the last number in a row that is greater than zero or finding the last zero in a row.

    I've tried a formula using MAX in A7 and another using INDEX/Match in A8. The MAX formula returns a date really off base and the INDEX/MATCH formula returns the first date that has a zero, not the last date.

    Cells B7 equal what the date should be if using the last zero and cell C7 is the date with the last volume. Either solution or both would be great.

    Thank you very much in advance for any support.

  2. #2
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: How to enter date associated with last number greater than zero or last zero in row

    First, try to convert column title in row 6 into real date:
    D6: 1/1/2020
    E6 and drag accross:
    Please Login or Register  to view this content.
    to present increasing month by 1, including the year total (column right after month 12)
    Then, in B7, end date that last volume >0 (exclude total volume in year column)
    Please Login or Register  to view this content.
    **Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
    A7, volumn
    Please Login or Register  to view this content.
    Due to sucuri firewall stop me, I have to use less than or greater than, sorry about that.
    Last edited by bebo021999; 06-29-2020 at 10:48 PM. Reason: Wrong attachment, upload again.
    Quang PT

  3. #3
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: How to enter date associated with last number greater than zero or last zero in row

    Hi, I have questions:
    - "either the last number in a row that is greater than zero or finding the last zero in a row" - this would imply you're looking for the last number in a row only? e.g. whatever the last number is, 10000 or 0, it would always fulfill your criteria?
    - your desired data in columns B and C make no sense to me: e.g. in row 15: you say volume ends Feb-2020 but the last value is actually Jan-2022?
    - Your column headers are no dates but text strings for month and year only, so how does your desired output get to specific days?

    Can you clarifiy if the following is what you're trying to do: When the total of a year is >0, you want the month (and year) of the last non-zero value? (e.g. the last non-zero month ignoring year totals)

    I also believe your task is complicated by the fact that:
    - you have row totals within your actual monthly data rather than at its end
    - your column headers are text strings rather than actual dates

    But put in this formula for row 7 (may have to be entered with ctrl+shift+enter) and see if it does what you're looking for:
    =LOOKUP(2,1/((RIGHT(H6:AT6,4)*(LEN(H6:AT6)>4)=LOOKUP(2,1/(ISNUMBER($H$6:$AT$6)*(H7:AT7>0)),$H$6:$AT$6))*(H7:AT7>0)),H$6:AT$6)

    Regards

  4. #4
    Valued Forum Contributor
    Join Date
    02-06-2013
    Location
    Germany
    MS-Off Ver
    365
    Posts
    490

    Re: How to enter date associated with last number greater than zero or last zero in row

    @bebo021999, you may want to check the workbook you attached, seems like something else?

    Regards

  5. #5
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,463

    Re: How to enter date associated with last number greater than zero or last zero in row

    Quote Originally Posted by RaulSerg View Post
    @bebo021999, you may want to check the workbook you attached, seems like something else?

    Regards
    Thank you,
    Update already.

  6. #6
    Forum Contributor
    Join Date
    05-08-2015
    Location
    Asheville NC
    MS-Off Ver
    Excel for Office 365 MSO
    Posts
    111

    Re: How to enter date associated with last number greater than zero or last zero in row

    @bebo021999, thank you for the support. Your formulas worked well and solved my issue. I especially liked the formula used in E6.

    @RaulSerg, thank you also for the feedback. I could not get your formula to work in A7 using as an array or just entering. The result was #N/A each time.
    For your questions:
    -"either the last number..." I was looking for a formula that would tell me what date the last volume was entered. the volume (or number) would have to be greater than zero. My issue was there are months when there are no orders but future orders still are placed. My original formula would stop at the first instance of no order. The formula bebo021999 used in B7 worked for this issue.
    -"your desired data...row15..." Feb 2020 was a typo, apologies, I meant for it to be Feb 2022 to show this was the last zero after a cell with a value greater than zero.
    - "Your column headers are text..." Agreed and corrected using bebo021999 formula.

    Thank you both again for the feedback and efforts.

+ 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 a date is greater than another date; return a certain number of days
    By kmrz in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 02-26-2020, 11:43 PM
  2. [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
  3. Want to count number of dates greater than a stated date
    By bjorng in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-09-2014, 09:12 PM
  4. [SOLVED] Find number of days greater than zero between date range.
    By Mayzach in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 08-30-2013, 02:17 PM
  5. [SOLVED] calculates number of days less than or greater than x (a specific date)
    By t2dela in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-07-2013, 10:11 AM
  6. Enter date and Number to find the result
    By Pinkster69 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-20-2012, 06:46 PM
  7. [SOLVED] Excel: I enter date and format for date, but shows as number
    By spohar in forum Excel General
    Replies: 2
    Last Post: 03-10-2006, 04:45 PM

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