• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to get first non-zero value from the row

ThrottleWorks

Excel Ninja
Hi,

Apologies for not uploading sample file. I will try to explain the data in details.

Dummy data details as below;
I have data from range A1:L5,
Range A1 value 01-01-2015, range B1 value 01-02-2015, range C1 value 01-03-2015 and so on till Column L, range L1 value is 01-12-2015.

I need to fill formula in Column M, that will be range M2:M5. (desired output).

range A2 value = 0, range B2 value is 1, which is first instance of non-zero value in row 2:2.

Formula in range M2 "=TODAY()-B1"

range A3 value = 0, range B3 value = 0, range C3 value = 1, formula in range M3 = "=TODAY()-C1"

range A4 value = 0, range B4 value = 0, range C4 value = 0, range D4 value = 1, formula in range M4 = "=TODAY()-D1".

I am trying to calculate today's date - first instance date of non-zero value.
I am not able to get first instance of non-zero value from the row.

Can anyone please help me in this.
 
Array-Enter (Ctrl+Shift+Enter, rather than just Enter) the following in cell M2 and copy down:
=TODAY()-INDEX($A$1:$L$1,MATCH(TRUE,$A2:$L2<>0,0))
 
Back
Top