Forum Discussion
Kyle_P19
Jul 12, 2020Copper Contributor
Saving reference down a column as its reference is changed
Hello, I would like to calculate total sales amounts by simply typing the number of sales, and using a selector box to determine the product being sold, and thus the amount made on the sale. My pro...
mathetes
Jul 12, 2020Gold Contributor
See the attached for one solution.
You just needed to make the drop down part of the row in which the calc took place. And assuming your real world application has more than two products, use VLOOKUP rather than your IF formulation to determine the per unit price.
OwenPrice
Jul 12, 2020Iron Contributor
This is the right solution to calculate line-item totals providing the intention of Number of Sales is "units sold" and not "line item / row number" (it's not clear to me which is intended tbh).
Additionally, I think Kyle_P19 was looking for a running total in the Total column, but a quick adjustment in the first row of the total column to this:
=SUMPRODUCT($D$6:D6,$E$6:E6)and then dragged down to the range of the cells, would achieve that.