I'm looking how to to do a math operations for specific row depend on the row the switch formula append.
The challenge
- I have a table with product, their product price and a shipment price.
- The shipment price depend on the product. So the calculation must be a specific part of the product price.
- Also I have a lot of products and the calculation of the shipment is changed frequently. I'm trying to enter the formula at only one place, to be able to maintarate it easier in the future.
How the table looks like
1 A Product |
B Product price |
C Shipment price |
---|---|---|
2 Product-1 |
5 | My formula is here |
3 Product-2 |
10 | |
4 Product-3 |
15 |
My formula
=SWITCH (
A2:A,
"Product-1", B2:B*2.0,
"Product-2", B2:B*3.0,
"Product-3", B2:B*3.0,
0
)
The issue
Insted to get the shipment price for each row I get it only for the first row (B2) and it is applied for the whole column (C).
TL;DR
I'm new to Google sheets formulas. So far I was able to find everything that I need in ther documentation but I'm stuck to one issue. I tried to find a solution but sinse I'm new to it I'm not sure with what keywords to search. Maybe it's something very simple but please don't judge me.
Also the example is simplified, do not look for logic in the fact that the Shipment price is determined according to the product.