to get last row of each day from excel sheet -
i need find last record of each day in excel if there multiple entries
*******intention eod balance row of each date********
like have data in excel
date cr_dr amount eod balance ---------------------- 7/9/2017 19:09 cr 10 10 7/10/2017 18:37 cr 25 35 7/10/2017 21:06 dr 10 25 7/11/2017 19:21 cr 15 40 7/15/2017 14:17 dr 20 20 7/17/2017 17:12 cr 100 120 7/18/2017 7:44 dr 30 90 7/18/2017 14:08 dr 50 40 7/18/2017 16:52 cr 120 160
for need data (get last row of each day)
7/9/2017 19:09 cr 10 10 7/10/2017 21:06 dr 10 25 7/11/2017 19:21 cr 15 40 7/15/2017 14:17 dr 20 20 7/17/2017 17:12 cr 100 120 7/18/2017 16:52 cr 120 160
solution 1
enter following formula in cell f2
=iferror(max(if(int($a$2:$a$10)=int(index($a$2:$a$10, match(0, frequency(if(exact(int($a$2:$a$10), transpose(int($f$1:f1))), match(row($a$2:$a$10), row($a$2:$a$10)), ""), match(row($a$2:$a$10), row($a$2:$a$10))), 0))),$a$2:$a$10,0)),"")
this array formula commit pressing ctrl+shift+enter. drag/copy down required.
then in cell g2
enter
=vlookup($f2,$a$2:$d$10,column(c1)-column($a$1),false)
drag formula across (to right) till cell i2
, down required.
see image reference.
solution 2
instead of using ugly looking long formula, here we'll use helper column.
in cell f2
enter following formula
=max(if(int($a$2:$a$10)=int(a2),$a$2:$a$10,0))
this array formula commit pressing ctrl+shift+enter. drag/copy down required.
then in cell g2
enter
=iferror(index($f$2:$f$10,match(0,index(countif($g$1:g1,$f$2:$f$10),0,0),0)),"")
drag/copy down required.
finally, in cell h2
enter
=vlookup($g2,$a$2:$d$10,column(c1)-column($a$1),false)
drag formula across (to right) till cell j2
, down required.
see image reference.
edit : per comment.
instead of
=vlookup($g2,$a$2:$d$10,column(c1)-column($a$1),false)
use below formula in cell h2
=index(b$2:b$10,max(if($a$2:$a$10=$g2,row($a$2:$a$10)-row(index($a$2:$a$10,1,1))+1)))
this array formula commit pressing ctrl+shift+enter. drag formula across (to right) till cell j2
, down required. drag/copy down required.
screen-shot :
Comments
Post a Comment