IF Statement Based on Text Value in Cell

acool

Board Regular
Joined
Feb 10, 2023
Messages
107
Office Version
  1. 365
Platform
  1. Windows
Hi Everyone,

I would like to create an IF Statement which states that if my product category on the right is equal to cell value of "Protein,", "Plant Protein," or "Protein Gainer" then discount 20% off the Original Price. If Product category is not one of the ones listed above, I would like to use the original price provided. Any help or insight would be greatly appreciated! Thank You!


1679925553120.png
 

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).
If your product is in cell A2 and your price in B2, put this formula in cell C2:
Excel Formula:
=IF(ISNUMBER(SEARCH("protein",A2)),B2*(1-20%),B2)
Note that you can replace the "20%" with a cell reference, if that is being stored somewhere.
 
Upvote 0
Maybe like
Excel Formula:
=B2*(1-IF(COUNTIFS(A2,"*protein*"),$D$2,0))
 
Upvote 0

Forum statistics

Threads
1,214,840
Messages
6,121,895
Members
449,058
Latest member
Guy Boot

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top