I am building an app where the same item can be sold multiple times, retaining it’s itemID. This is important because we want to be able to get a history of that item.
I have the following
=ARRAYFORMULA(IF(LEN($A3:$A) = 0, “first”, IF(ISERROR(VLOOKUP($A3:$A, Sales!$A3:$A, 1, false)), “”, VLOOKUP($A3:$A, Sales!$A3:$C, 3, false)))) to assign a new owner. All it’s doing is looking at a table like this
itemID From To Price
39 firstname.lastname@example.org email@example.com -10.00
6 firstname.lastname@example.org email@example.com -10.00
11 firstname.lastname@example.org email@example.com -10.00
71 firstname.lastname@example.org email@example.com -10.00
39 firstname.lastname@example.org email@example.com -25.00
32 firstname.lastname@example.org email@example.com -10.00
The problem is that the formula trying to determine the current owner of the items but is only returning itemID 39 in its first instance.
Item 39 has first been sold by the app to laura and then sold by laura to sandro.
Yet the formula is only returning the email of the first transaction as the current owner.
I saw that with VLOOKUP you can turn to false and sometimes it returns the last entry but it doesn’t seem to work for mine.
Anyone knows how I can solve this?