srinidhi Active Member Jul 10, 2016 #1 HI, I need a formula which counts the number of cells which has 0 from right to left unit a first number cell (greater than 0) is reached: EX: Jan'16 Feb'16 Mar'16 Apr'16 May'16 June'16 Answer Count Blank 1 - 3 - 5 - 1 - 4 5 6 - - 2 1 - - - - - 5 - - 3 - 5 - 1
HI, I need a formula which counts the number of cells which has 0 from right to left unit a first number cell (greater than 0) is reached: EX: Jan'16 Feb'16 Mar'16 Apr'16 May'16 June'16 Answer Count Blank 1 - 3 - 5 - 1 - 4 5 6 - - 2 1 - - - - - 5 - - 3 - 5 - 1
Hui Excel Ninja Staff member Jul 10, 2016 #2 G2: =6-MAX(IF(A2:F2>0,COLUMN(A2:F2))) Ctrl+Shift+Enter Copy down or more generically G2: =Column(F2)-MAX(IF(A2:F2>0,COLUMN(A2:F2))) Ctrl+Shift+Enter Copy down
G2: =6-MAX(IF(A2:F2>0,COLUMN(A2:F2))) Ctrl+Shift+Enter Copy down or more generically G2: =Column(F2)-MAX(IF(A2:F2>0,COLUMN(A2:F2))) Ctrl+Shift+Enter Copy down
B bosco_yip Excel Ninja Jul 10, 2016 #4 Another approach of non-CSE formula. G1, copy down : =6-INDEX(MATCH(2,1/(A1:F1>0)),0) Regards Bosco