Skip to main content
Solved

If, then formula for percentage calculation


Hi, I’m wondering if there’s a way to do this. I have a table with the category of a used book and the original price. I want to create a formula that calculates the selling price based on the category of the book. So it would be IF category = A then take Original Price and deduct 30% to get the selling price. I’m not sure if I can do all of this in one go with an IF formula. But maybe I can do part of it? Thanks for the help!

Best answer by Jeremy_Oglesby

You can do this much more efficiently with a SWITCH() function:

{Price} *
SWITCH(
   {Category},
   "A", 0.7,
   "B", 0.6,
   "C", 0.8
)
View original
Did this topic help you find an answer to your question?

5 replies

Hi @Ons_Stories,

Yes you can do that. You would use a nesting IF formula. Something like IF({Category}=A, Price0.7, if({Category}=B, Price0.75, … and so on

And so on.

This formula can be a little tricky, if you need help with it just let me know. I will need to see a screenshot of your table and know what you are trying to achieve with that formula.

BR,
Mo


  • Author
  • New Participant
  • 3 replies
  • February 15, 2020
Mohamed_Swella1 wrote:

Hi @Ons_Stories,

Yes you can do that. You would use a nesting IF formula. Something like IF({Category}=A, Price0.7, if({Category}=B, Price0.75, … and so on

And so on.

This formula can be a little tricky, if you need help with it just let me know. I will need to see a screenshot of your table and know what you are trying to achieve with that formula.

BR,
Mo


Thanks, but yeah this didn’t help. It says there’s a problem with the formula and I’m not sure how to fix it. In the screenshot below you’ll see what I typed in the formula. I’m trying to formulate 70% of the Original Price IF Category = A and IF Category = B then 60% and so on!


  • Author
  • New Participant
  • 3 replies
  • February 15, 2020
Ons_Stories wrote:

Thanks, but yeah this didn’t help. It says there’s a problem with the formula and I’m not sure how to fix it. In the screenshot below you’ll see what I typed in the formula. I’m trying to formulate 70% of the Original Price IF Category = A and IF Category = B then 60% and so on!


It won’t let me upload screenshots, sorry


  • Inspiring
  • 1691 replies
  • Answer
  • February 15, 2020

You can do this much more efficiently with a SWITCH() function:

{Price} *
SWITCH(
   {Category},
   "A", 0.7,
   "B", 0.6,
   "C", 0.8
)

  • Author
  • New Participant
  • 3 replies
  • February 15, 2020

That worked thanks a lot!


Reply