Hi,
So I was hoping someone could help me out with formulas. i have some data and I would like a formula that can show me if data offsets between two accounts. So I have the below data:
[TABLE="width: 799"]
<tbody>[TR]
[TD="class: m_-5595038335429118977gmail-xl268, width: 135, align: right"](A)date/time[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 96, align: right"](B)product[/TD]
[TD="class: m_-5595038335429118977gmail-xl270, width: 82, align: right"](C)amount[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 90, align: right"](D)Buy/Sell[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 76, align: right"](E)price[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 85, align: right"](F)account[/TD]
[TD="class: m_-5595038335429118977gmail-xl260, width: 85, align: center"](G)amount[/TD]
[TD="class: m_-5595038335429118977gmail-xl272, width: 150, align: right"]offset?[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/3/2019 17:00[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]spoon[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]10[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]B[/TD]
[TD="align: right"]1.22[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]10[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/3/2019 17:01[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]fork[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]8[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-8[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/3/2019 17:01[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]knife[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]12[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]1.15[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-12[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:49[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]plate[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]15[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-15[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]123/456 offset[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:49[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]cup[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]30[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]2.5[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-30[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]123/456 offset[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:51[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]plate[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]15[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]B[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]456[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]15[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:52[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]cup[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]30[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]B[/TD]
[TD="align: right"]2.5[/TD]
[TD="align: right"]456[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]30[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
</tbody>[/TABLE]
So, right now, I have formulas in the amount column and the offset column.
amount formula: IF(D2="B",C2,-C2)
offset? formula: IF(AND(F2=123,SUMIFS(<wbr>G:G,F:F,123,E:E,E2)+SUMIFS(G:<wbr>G,F:F,456,E:E,E2)=0),"123/456 offset","unmatched")
So if the account is 123, I want it to take the sum of the amount column (G) taking the account, product, and price into account and see if it has be offset by the sum of the same details in 456 account. I would also like to be able to take the date into account (ignoring the time) - so that if there was a cup sold at 2.5 on 6/14, it would be able to differentiate that and have separate sums it would be looking to offset for the 6/13 and the 6/14 cups.
(As an aside, I would also love it if I could somehow incorporate the amount directly into the offset formula and delete the amount formula, but it's not the one I really need to work.)
So I was hoping someone could help me out with formulas. i have some data and I would like a formula that can show me if data offsets between two accounts. So I have the below data:
[TABLE="width: 799"]
<tbody>[TR]
[TD="class: m_-5595038335429118977gmail-xl268, width: 135, align: right"](A)date/time[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 96, align: right"](B)product[/TD]
[TD="class: m_-5595038335429118977gmail-xl270, width: 82, align: right"](C)amount[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 90, align: right"](D)Buy/Sell[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 76, align: right"](E)price[/TD]
[TD="class: m_-5595038335429118977gmail-xl269, width: 85, align: right"](F)account[/TD]
[TD="class: m_-5595038335429118977gmail-xl260, width: 85, align: center"](G)amount[/TD]
[TD="class: m_-5595038335429118977gmail-xl272, width: 150, align: right"]offset?[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/3/2019 17:00[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]spoon[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]10[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]B[/TD]
[TD="align: right"]1.22[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]10[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/3/2019 17:01[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]fork[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]8[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-8[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/3/2019 17:01[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]knife[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]12[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]1.15[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-12[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:49[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]plate[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]15[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-15[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]123/456 offset[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:49[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]cup[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]30[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]S[/TD]
[TD="align: right"]2.5[/TD]
[TD="align: right"]123[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]-30[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]123/456 offset[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:51[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]plate[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]15[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]B[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]456[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]15[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
[TR]
[TD="class: m_-5595038335429118977gmail-xl265, align: right"]6/13/2019 19:52[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]cup[/TD]
[TD="class: m_-5595038335429118977gmail-xl266, align: right"]30[/TD]
[TD="class: m_-5595038335429118977gmail-xl271, align: right"]B[/TD]
[TD="align: right"]2.5[/TD]
[TD="align: right"]456[/TD]
[TD="class: m_-5595038335429118977gmail-xl264, align: right"]30[/TD]
[TD="class: m_-5595038335429118977gmail-xl267, align: right"]unmatched[/TD]
[/TR]
</tbody>[/TABLE]
So, right now, I have formulas in the amount column and the offset column.
amount formula: IF(D2="B",C2,-C2)
offset? formula: IF(AND(F2=123,SUMIFS(<wbr>G:G,F:F,123,E:E,E2)+SUMIFS(G:<wbr>G,F:F,456,E:E,E2)=0),"123/456 offset","unmatched")
So if the account is 123, I want it to take the sum of the amount column (G) taking the account, product, and price into account and see if it has be offset by the sum of the same details in 456 account. I would also like to be able to take the date into account (ignoring the time) - so that if there was a cup sold at 2.5 on 6/14, it would be able to differentiate that and have separate sums it would be looking to offset for the 6/13 and the 6/14 cups.
(As an aside, I would also love it if I could somehow incorporate the amount directly into the offset formula and delete the amount formula, but it's not the one I really need to work.)