L
Legacy 332279
Guest
Hey!
I've been looking around for a while in the forums, but haven't been able to find a solution. I'm working on an array formula that is supposed to determine when a price of an item has changed and what the new price is based on an inventory log that contains several different items. I've got the core functionality down, but I now struggle with two things:
1) I would like to omit all false values from the result, so that the resulting list doesn't contain any blank cells. I've tried using the solution provided by Aladin in this post, but I can't wrap my head around how to incorporate my array formula into that solution.
2) I would also like for the formula to include the first first registered price of an item, which the current formula omits, but again I'm unsure as to how.
This is the current array formula:
In essence the parent IF function checks if a row that contains data on an item (determined by an ID-number in Q3) has a different price than the previous row of data on the same item. If this is true, then it returns the time of the change (from column G) and the new price (from column I). If false, it simply returns false.
The following is the test sheet I've been using to create what I have so far (without irrelevant information):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]ID[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]S[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]T[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]V[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]01-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]102[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]01-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]90[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]103[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]200[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]102[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]90[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]60[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]60[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]102[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]80[/TD]
[/TR]
</tbody>[/TABLE]
Then, say if Q3 is set to 101, the following is a comparison of the current result and the desired result:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"] Current result[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"] Desired result[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"][/TD]
[TD="align: center"]01-01-15[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"][/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]60[/TD]
[/TR]
[TR]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]60[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
Any help would be greatly appreciated!
I've been looking around for a while in the forums, but haven't been able to find a solution. I'm working on an array formula that is supposed to determine when a price of an item has changed and what the new price is based on an inventory log that contains several different items. I've got the core functionality down, but I now struggle with two things:
1) I would like to omit all false values from the result, so that the resulting list doesn't contain any blank cells. I've tried using the solution provided by Aladin in this post, but I can't wrap my head around how to incorporate my array formula into that solution.
2) I would also like for the formula to include the first first registered price of an item, which the current formula omits, but again I'm unsure as to how.
This is the current array formula:
Code:
{=IF((INDEX(I:I,SMALL(IF(COUNTIF(Q3,A1:A10),ROW(A1:A10)-MIN(ROW(A1:A10))+1),ROW(INDIRECT("1:30"))))<>INDEX(I:I,SMALL(IF(COUNTIF(Q3,A1:A10),ROW(A1:A10)-MIN(ROW(A1:A10))+1),ROW(INDIRECT("2:30"))))),(INDEX(G:I,SMALL(IF(COUNTIF(Q3,A1:A10),ROW(A1:A10)-MIN(ROW(A1:A10))+2),ROW(INDIRECT("1:30"))),{1,3})))}
In essence the parent IF function checks if a row that contains data on an item (determined by an ID-number in Q3) has a different price than the previous row of data on the same item. If this is true, then it returns the time of the change (from column G) and the new price (from column I). If false, it simply returns false.
The following is the test sheet I've been using to create what I have so far (without irrelevant information):
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD="align: center"]A[/TD]
[TD="align: center"]B[/TD]
[TD="align: center"]C[/TD]
[TD="align: center"]D[/TD]
[TD="align: center"]E[/TD]
[TD="align: center"]F[/TD]
[TD="align: center"]G[/TD]
[TD="align: center"]H[/TD]
[TD="align: center"]I[/TD]
[/TR]
[TR]
[TD="align: center"]1[/TD]
[TD="align: center"]ID[/TD]
[TD="align: center"]N[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]P[/TD]
[TD="align: center"]S[/TD]
[TD="align: center"]M[/TD]
[TD="align: center"]T[/TD]
[TD="align: center"]Q[/TD]
[TD="align: center"]V[/TD]
[/TR]
[TR]
[TD="align: center"]2[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]01-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]3[/TD]
[TD="align: center"]102[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]01-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]90[/TD]
[/TR]
[TR]
[TD="align: center"]4[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]5[/TD]
[TD="align: center"]103[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]200[/TD]
[/TR]
[TR]
[TD="align: center"]6[/TD]
[TD="align: center"]102[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]90[/TD]
[/TR]
[TR]
[TD="align: center"]7[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]02-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]8[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]60[/TD]
[/TR]
[TR]
[TD="align: center"]9[/TD]
[TD="align: center"]101[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]60[/TD]
[/TR]
[TR]
[TD="align: center"]10[/TD]
[TD="align: center"]102[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]...[/TD]
[TD="align: center"]80[/TD]
[/TR]
</tbody>[/TABLE]
Then, say if Q3 is set to 101, the following is a comparison of the current result and the desired result:
[TABLE="width: 500"]
<tbody>[TR]
[TD="align: center"] Current result[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"] Desired result[/TD]
[/TR]
</tbody>[/TABLE]
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"][/TD]
[TD="align: center"]01-01-15[/TD]
[TD="align: center"]50[/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"][/TD]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]60[/TD]
[/TR]
[TR]
[TD="align: center"]15-01-15[/TD]
[TD="align: center"]60[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]FALSE[/TD]
[TD="align: center"]FALSE[/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
[TR]
[TD="align: center"]#NUM![/TD]
[TD="align: center"]#NUM![/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[TD="align: center"][/TD]
[/TR]
</tbody>[/TABLE]
Any help would be greatly appreciated!