+ Reply to Thread
Results 1 to 8 of 8

Vlookup for first value <> ZERO

  1. #1
    Registered User
    Join Date
    10-05-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Vlookup for first value <> ZERO

    I am trying to use a vlookup to fish through a column of data and find the first cell with a value <>0. In column B, I have a list of numbers; in column D a list of dates (in ascending order). I want to return the date that corresponds with the first value in column B. Maybe Vlookup isn't necessarily the best function to use... Would this be easier with index or match?

  2. #2
    Forum Contributor BeachRock's Avatar
    Join Date
    11-01-2011
    Location
    Oregon, United States
    MS-Off Ver
    Excel 2016
    Posts
    403

    Re: Vlookup for first value <> ZERO

    Can you upload an example workbook?
    -------------
    Tony

  3. #3
    Registered User
    Join Date
    10-05-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Vlookup for first value <> ZERO

    Here is a copy of the data I'm working with.
    Attached Files Attached Files

  4. #4
    Forum Contributor BeachRock's Avatar
    Join Date
    11-01-2011
    Location
    Oregon, United States
    MS-Off Ver
    Excel 2016
    Posts
    403

    Re: Vlookup for first value <> ZERO

    Hi ckatzman,

    I'm not sure if I understand what you need. Are you saying you want one cell to have a formula that will automatically display the first date that corresponds to the first entry in column B that is <>0?

    Can you elaborate more about how you envision this to be in the outcome?

  5. #5
    Registered User
    Join Date
    10-05-2012
    Location
    Los Angeles, CA
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Vlookup for first value <> ZERO

    I am looking for the date that corresponds with the first non-zero value in column B, i.e. B72 is the first non-zero value in this particular data set; the date that occurs on is Dec-04 in column D. Is there a way to have a formula find a value that is not equal zero in column B and return the date in column D?

  6. #6
    Forum Expert icestationzbra's Avatar
    Join Date
    01-07-2004
    MS-Off Ver
    2007, 2010
    Posts
    1,421

    Re: Vlookup for first value <> ZERO

    see if this helps:

    Please Login or Register  to view this content.
    you can change the parameters in highlighted portion to derive different results (such as for >0, =0 or <0 etc.)...
    - i.s.z -
    CSE, aka Array aka { }, formulae are confirmed with CONTROL+SHIFT+ENTER.
    Replace commas ( , ) with semicolons ( ; ) in formulae, if your locale setting demands.
    All good ideas are courtesy resources from this forum as well as others around the web.
    - e.o.m -

  7. #7
    Forum Contributor BeachRock's Avatar
    Join Date
    11-01-2011
    Location
    Oregon, United States
    MS-Off Ver
    Excel 2016
    Posts
    403

    Re: Vlookup for first value <> ZERO

    Sorry katz, I still don't understand.

    You already have the dates in column D aligned with the numbers in column B.... Where do those dates come from, another sheet? Something is missing from this equation...

  8. #8
    Registered User
    Join Date
    08-28-2012
    Location
    wisbech england
    MS-Off Ver
    Excel 2003
    Posts
    7

    Re: Vlookup for first value <> ZERO

    Hi Ckatzaman,
    if i understood rightly you just need to find the first non zero value based on sorted date...if yes try this
    create an incremental flag that assume value = 1 as soon as it is in correspondence of a non zero value, from that moment onward will increase by one.
    Than by using index and match you can find the date associated to the flag 1. ( in this way you can find the first the second etc)
    Flag:

    Assuming that your set of date starts at row 5, in cell M5 insert the formula: =IF(AND(OR(B4=0,ISTEXT(B4)),B5=0),IF(ISERROR(0+M4),0,(0+M4)),IF(ISERROR(M4+1),1,(M4+1)))
    To find the date:

    insert the following formula in any cell in the worksheet:=INDEX(D5:D10,MATCH(1,M5:M10,FALSE),1) "I ASSUME THAT THE DATA RANGE IS BETWEEN B5 AND B10".

    I ALSO ADDED SOME ERROR HANDLER IF YOU WANT TO ADD THE HEAD FOR THE FLAGS.

    I hope it helps

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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