I am making a spreadsheet for taxes on my crypto purchases and sales. I have the QUERY function to pull the data from my main sheet to my TAX sheet but I need my amount of coins to show up negative on a sale. I want to make a number negative if "sell" is present or keep it positive if "buy". I am trying to use an IF statement inside a QUERY.
=QUERY(Trading!$A$3:H1001, "select A,B,C,D,E,G,H where B contains 'Crypto.com'" & if(Trading!F:F = "SELL", Trading!D:D-1, Trading!D:D1))
The locked pages are editable but are just used to gather or receive data from the Trading page.