+ Reply to Thread
Results 1 to 6 of 6

Function or Formula to Return a Date When a Non-zero Value is Found in a Row

  1. #1
    Registered User
    Join Date
    01-21-2011
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    30

    Function or Formula to Return a Date When a Non-zero Value is Found in a Row

    I don't know if the caption sufficiently explains what I am trying to accomplish so I have attached a sample workbook. This is in excel 2007. Any ideas on how to get this done would be appreciated.Sample **** 09-19-14.xlsx

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Function or Formula to Return a Date When a Non-zero Value is Found in a Row

    Try these...

    Enter this array formula** in P4:

    =IFERROR(INDEX(C$3:N$3,MATCH(TRUE,C4:N4>0,0)),"")

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.

    Format in the date style of your choice.

    Enter this formula in Q4:

    =IFERROR(LOOKUP(2,1/C4:N4,C$3:N$3),"")

    Format in the date style of your choice.

    Select P4:Q4 and copy down as needed.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Function or Formula to Return a Date When a Non-zero Value is Found in a Row

    I was trying to avoid the use of array formulas since it sounds like you have a lot of data. Use Tony's Q4 formula, as mine was pretty much the same, but for P4, try this:
    =EOMONTH(Q4,-COUNTIF(C4:N4,">0")+1)

    Now, mine is making an assumption, in that the numbers are in blocks with no zero/blank values between the beginning and the end. Also, your calculation of the months up top by always adding 31 is going to cause problems as you expand that out a few years. But, I assumed you would have correct dates in your final spreadsheet.
    Pauley
    --------
    If I helped with your issue, I'd appreciate a rep bump (hit the '*' icon to the bottom left of this post).

  4. #4
    Registered User
    Join Date
    01-21-2011
    Location
    Dallas, Texas
    MS-Off Ver
    Excel 2007
    Posts
    30

    Re: Function or Formula to Return a Date When a Non-zero Value is Found in a Row

    Thanks for the resolution Tony. The only thing I had to do was change the formulas in my data table which were index formulas to return zero instead of blank. Once I changed those formulas it worked like a charm. Pauleyb, I wish I had seen your comment before I changed all the index formulas. Thanks again both of you as my problem has been asked and answered. You rock!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Function or Formula to Return a Date When a Non-zero Value is Found in a Row

    You're welcome. Thanks for the feedback!


    If your question has been solved please mark the thread as being solved.

    In the menu bar above the very first post select Thread Tools, then select Mark this thread as solved.

  6. #6
    Forum Expert
    Join Date
    06-26-2010
    Location
    Austin, TX
    MS-Off Ver
    Excel 2010
    Posts
    1,673

    Re: Function or Formula to Return a Date When a Non-zero Value is Found in a Row

    Removed original text. Please ignore.

+ 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] Return every date of multiple occurrences found in array
    By roothog in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2013, 12:37 AM
  2. Find a min value and return date where it was found
    By ABSTRAKTUS in forum Excel General
    Replies: 6
    Last Post: 05-22-2010, 10:14 PM
  3. Return number of days until a date found in a lookup table
    By midwestgirl80 in forum Excel General
    Replies: 1
    Last Post: 08-08-2009, 10:07 PM
  4. No RETURN() or HALT() function found on macro sheet
    By arun.darra@gmail.com in forum Excel General
    Replies: 2
    Last Post: 07-12-2006, 02:15 AM
  5. [SOLVED] Date Function formula that will return the date of a specific week
    By Greg in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-12-2006, 12:10 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