Tough formula problem

J

Joker

I have a spreadsheet which tracks employee transactions and times. In column
L, I have the following formula.
=IF($D2=13328000,$J3-$J2,IF($D2=13328100,$J3-$J2,IF($D2=13328200,$J3-$J2,IF($D2=13280300,$J3-$J2,IF($D2=13280800,$J3-$J2,IF($D2=13288100,$J3-$J2,IF($D2=13286500,$J3-$J2,"")))))))
In column D are different codes like 13286500 or 10051202. Sometimes some of
the codes get out of sequence which skews my results. The last part of the
formula is where this is happening IF($D2=13286500,$J3-J2,""). If everything
is done in the right sequence, it works fine, but sometimes they get out of
sequence. For it to work correctly, for example, cell D2 would be 13286500,
cell D3 would be 10051202 and cell D4 would be 10026100. When it gets out of
sequence, the value that should be in cell D3 would be before cell D2 in cell
D1 and cell D3 is now in D2. Is there something that I could add to my
existing formula that would calculate $J1-$J2 if 10051202 is the cell above
13286500 instead of below it? I know this is confusing and I hope I
explained it okay. A solution to this problem would be greatly appreciated.
Thank you
 
S

Sandy Mann

Would:

=IF(OR(D1={13328000,13328100,13328200,13328300,13280800,13288100,13286500},D2={13328000,13328100,13328200,13328300,13280800,13288100,13286500},D3={13328000,13328100,13328200,13328300,13280800,13288100,13286500}),J2-J3,"")

do what you want?

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top