+ Reply to Thread
Results 1 to 11 of 11

Formula to find first non zero value in a column

Hybrid View

  1. #1
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2011
    Posts
    7

    Formula to find first non zero value in a column

    Hi Guys!

    I have a column where I need to find the first non zero value and have whatever that lowest value is be returned in a different cell. In the example provided it would be 5 that Id liked returned in A16. The colunm itself changes based upon other inputs so any one cell from A1 till A13 could be all 0. Ive been using =INDEX(A1:A14,MATCH(0,A1:A14,-1)) in array format as well but it just keep returning 12 as the answer.

    Any thoughts?

    Much love,

    Chin
    Attached Files Attached Files

  2. #2
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula to find first non zero value in a column

    You could use this Array Formula.

    =INDEX(A1:A1000,MATCH(TRUE,A1:A1000<>0,0))

    It must be confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU

  3. #3
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2011
    Posts
    7

    Re: Formula to find first non zero value in a column

    Hi Glenn,

    Thank you your formula works but only if the 0 is on the right hand side of the column not the left. Ive attached a screenshot with the formula I used to calculate those 0s. As you can see at the very bottom of the screen shot my output is still 0 and not 5200 as I'd like it to be. Any ideas?
    Attached Images Attached Images

  4. #4
    Registered User
    Join Date
    04-30-2019
    Location
    US
    MS-Off Ver
    365
    Posts
    12

    Re: Formula to find first non zero value in a column

    Quote Originally Posted by chinchillin View Post
    Hi Glenn,

    Thank you your formula works but only if the 0 is on the right hand side of the column not the left. Ive attached a screenshot with the formula I used to calculate those 0s. As you can see at the very bottom of the screen shot my output is still 0 and not 5200 as I'd like it to be. Any ideas?
    Late to the party here, but your formula should be

    =IF($C$2:$C$51<$B$5,0,(ugly thing in parens))

    with the zero NOT in quotes. This returns zero as a numerical value, not a text label.

  5. #5
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to find first non zero value in a column

    Try this array formula

    =INDEX(A:A,SMALL(IF(--A1:A100<>0,ROW(A1:A100)),1))

    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  6. #6
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula to find first non zero value in a column

    I'm heading out now and I can't read your screenshot on my phone's screen. But, if the zero is in the left, it is because it is text that looks like a zero. In an empty column you could do something like:

    =--A1

    and copy down. Alter the array to look in the new column. The -- coerces Excel into recognising a text 0 as a numerical 0.

  7. #7
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,791

    Re: Formula to find first non zero value in a column

    Another way.....array-entered also
    Formula: copy to clipboard
    =INDEX($A$1:$A$14,MATCH(1,($A$1:$A$14<>0)*ISNUMBER($A$1:$A$14),0))

  8. #8
    Registered User
    Join Date
    03-25-2015
    Location
    USA
    MS-Off Ver
    2011
    Posts
    7

    Re: Formula to find first non zero value in a column

    Thanks a lot for all of the help everyone you solved the problems no prob,much appreciated!!!

  9. #9
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 V 2506
    Posts
    13,791

    Re: Formula to find first non zero value in a column

    Likewise here, too....and thanks for the rep!

  10. #10
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Formula to find first non zero value in a column

    Thank you for the feedback!

    Please mark thread as "Solved" if your issue has been resolved. (Selecting Thread Tools -> Mark thread as Solved).

  11. #11
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2406
    Posts
    44,662

    Re: Formula to find first non zero value in a column

    Likewise - thanks for the Reputation. Much appreciated.

+ 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. Replies: 5
    Last Post: 03-18-2015, 10:14 AM
  2. To Find and Insert column and add Formula and copy formula down
    By Akatecho in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2014, 11:52 PM
  3. Formula to find all matches in column A and return cells from column C
    By GenericPat in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-19-2012, 04:56 PM
  4. Modify Formula to Find Last Column
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-18-2011, 05:31 AM
  5. Replies: 1
    Last Post: 09-20-2010, 01:50 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