assets - Multiple fields formula excel -
assets - Multiple fields formula excel -
i have question using formulas in excel.
i have workbook 2 tables. table 1 contains planned transports different assets, , table 2 contains actual arrivals same transports.
table 1 looks this:
asset#|from|to |planned departure|planned arrival |actual arrival| 10 |abc |bbb |11.11.2014 09:00 |11.11.2014 10:00| 20 |abc |ccc |11.11.2014 09:00 |11.11.2014 11:00| 10 |bbb |ccc |11.11.2014 09:00 |11.11.2014 11:00| 10 |ccc |abc |11.11.2014 09:00 |11.11.2014 12:00|table 2 looks this:
asset#|to |actual arrival| 10 |bbb|11.11.2014 09:56 10 |ccc|11.11.2014 10:55 20 |ccc|11.11.2014 11:05 10 |abc|11.11.2014 12:01what do, populate field "actual arrival" in table 1 info table 2. have events in table 2 matches asset#, site field "to",and greater datetime in field "planned departure".
result this:
asset#|from|to |planned departure|planned arrival |actual arrival| 10 |abc |bbb |11.11.2014 09:00 |11.11.2014 10:00|11.11.2014 09:56 20 |abc |ccc |11.11.2014 09:00 |11.11.2014 11:00|11.11.2014 11:05 10 |bbb |ccc |11.11.2014 09:00 |11.11.2014 11:00|11.11.2014 10:55 10 |ccc |abc |11.11.2014 09:00 |11.11.2014 12:00|11.11.2014 12:01table 1 contains 1500 rows, , table 2 contains 5000 rows.
is possible formulas in excel, or have utilize vba or access?
assuming table 1 named sheet1 , table 2 named sheet2 , info in sheet1!a1:f[n] , sheet2!a1:c[n] achieved next array formula in sheet1!f2 , filled down:
{=index(sheet2!$c$1:$c$10000,min(if(($a2=sheet2!$a$1:$a$10000)*($c2=sheet2!$b$1:$b$10000)*($d2<sheet2!$c$1:$c$10000),row(sheet2!$c$1:$c$10000),10000+1)))}
to come in array formula have come in formula without curly brackets , press [ctrl]+[shift]+[enter] instead of [enter]. curly brackets should added automatically.
because array formulas slow whole columns, have limited 10000 rows. if small, have increment 10000 within formula.
sheet1:
sheet2:
the formula returns #ref if there no possible arrivals departure time. avoid wrap formula iferror like:
{=iferror(index(sheet2!$c$1:$c$10000,min(if((a2=sheet2!$a$1:$a$10000)*(c2=sheet2!$b$1:$b$10000)*(d2<sheet2!$c$1:$c$10000),row(sheet2!$c$1:$c$10000),10000+1))),"no arrival in sheet2 until now")}
excel assets lookup
Comments
Post a Comment