ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Tough formula problem (https://www.excelbanter.com/excel-discussion-misc-queries/128707-tough-formula-problem.html)

Joker

Tough formula problem
 
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

Sandy Mann

Tough formula problem
 
Would:

=IF(OR(D1={13328000,13328100,13328200,13328300,132 80800,13288100,13286500},D2={13328000,13328100,133 28200,13328300,13280800,13288100,13286500},D3={133 28000,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


with @tiscali.co.uk


"Joker" wrote in message
...
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






All times are GMT +1. The time now is 11:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com