excel - Formula for row artificial shift -


i've been doing weeks no avail, i'll give context it'd easier understand: have several sets of warehouse materiel codes sorted smallest largest time need delivered workshop processing , amount of pallets required @ each specific time frame, here how looks:

mat. code   time      pallets 65504606    07:30:00    2 65504606    10:30:00    1 65504606    13:30:00    2 65504606    16:30:00    1 65504606    19:30:00    2 65504606    22:30:00    1 65504606    01:30:00    2 65504606    04:30:00    1 

i'm matching data worksheet containing information on each individual pallet stored, need shift values in time column specific pallet delivered on time, here's i'd like:

mat. code   location    time     cell shift 65504606    91-04-03/1  7 30           0 65504606    76-13-03/1  7 30          -1 65504606    97-19-03/1  10 30         -1 65504606    97-16-03/3  13 30         -1 65504606    76-19-02/1  13 30         -2 65504606    97-18-03/1  16 30         -2 65504606    97-18-03/2  19 30         -2 65504606    88-07-02/1  19 30         -3 

i figured shift cells artificially adding column (cell shift - has negative because amount of rows in sheet i'm matching smaller, plus i'm using index - small formula combination matching each consecutive row of every set of codes), formula combinations i've tried giving me wrong numbers. amount of pallets can vary 0 9 , go in no particular order.

i know it's lot of confusing information, me out if come proper formula. in advance!

what want in restricted range.
did restricting range use simple vlookup.
op asked additional input use in formula.

=vlookup(c2,offset(yourfirsttablewithpalletnums!$a$1,match(a2,yourfirsttablewithpalletnums!$a:$a,0)-1,1,countifs(yourfirsttablewithpalletnums!$a:$a,a2),2),2,false) 

p.s. works if time values time values , not strings question implies.

edit:

=row(offset(yourfirsttablewithpalletnums!$a$1,match(whereyoulookupfrom!$c2,offset(yourfirsttablewithpalletnums!$a$1,match($a2,yourfirsttablewithpalletnums!$a:$a,0)-1,1,countifs(yourfirsttablewithpalletnums!$a:$a,$a2)),0),1))-row() 

then need 1 more shift , take applicable row (we're still operating ranges in case). when added uploaded file worked perfectly.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -