How to Use the IF Function for Discounts in Excel (4 Examples)

Dataset Overview

In the dataset, we have prices of various products as well as a conditional discount percentage.

how to use if function in excel for discounts intro


Example 1 – Discount for Proces Exceeding $25

Suppose you have a dataset with product prices, and you want to apply an 8% discount to products whose price exceeds $25. Here’s how you can do it:

  • Create a new column for discounted prices (let’s say in cell D5).
  • Enter the following formula in cell D5:

=IF(C5>$C$12,C5*(1-$C$13),C5)

This formula calculates the discounted price for the product in cell C5 if its price exceeds $25.

  • Press ENTER, and you’ll see the discounted price for “Gingerale” (assuming it exceeds $25).

how to use if function in excel for discounts example 1

  • Use the Fill Handle to apply the formula to other cells in the column.

  • The products in rows 7 and 8 won’t have a discount because their prices don’t exceed $25.

Example 2 – Discount for Prices Below $40

Now, let’s set a discount for products with prices below $40:

  • Create a new column for discounted prices (again, in cell D5).
  • Insert this formula in cell D5:

=IF(C5<$C$12,C5*(1-$C$13),C5)

how to use if function in excel for discounts example 2

This formula calculates the discounted price for the product in cell C5 if its price is below $40.

  • Press ENTER, and you’ll see the discounted price for “Gingerale” (assuming its price is below $40).

  • AutoFill the formula down to other cells.

how to use if function in excel for discounts example 2

The products in rows 6, 9, and 10 won’t have a discount because their prices aren’t below $40.


Example 3 – Discount for Prices Within a Range ($15 to $50)

Suppose you want to set a discount for products priced between $15 and $50:

  • Create a new column for discounted prices (once more, in cell D5).
  • Enter this formula in cell D5:

=IF(AND(C5>15,C5<50),C5*(1-$C$13),C5)

The AND function ensures the condition falls within the price range.

  • Press ENTER, and you’ll see the discounted price for “Gingerale” (assuming its price is between $15 and $50).

how to use if function in excel for discounts example 3

  • AutoFill the formula down to other cells.

The products in rows 6, 7, and 9 won’t have a discount because their prices aren’t within the range of $15 to $50.


Example 4 – Calculating Discounts Based on Product Type

Suppose you want to apply discounts based on whether a product is of the “liquid” type. Follow these steps:

  • Identify liquid products and mark them (e.g., with “(Liquid)”).
  • Create a new column for discounted prices (let’s say in cell D5).
  • In cell D5, insert the following formula:

=IF(RIGHT(B5,8)="(Liquid)",C5*(1-$C$13),C5)

    • This formula calculates the discounted price for the product in cell C5:
      • If the product is tagged as “liquid,” it applies the discount (1 – discount percentage) to the original price (C5).
      • If the product is not liquid, it keeps the original price (C5).

how to use if function in excel for discounts example 4

  • Press ENTER to see the discounted price for “Gingerale” (assuming it’s a liquid product).

  • Use the Fill Handle to apply the formula to other cells in the column.

how to use if function in excel for discounts

The products in rows 6, 7, 9, and 10 won’t have a discount because they are not liquid-type products.


Practice Section

We have given you the dataset of this article so that you can practice these methods on your own.


Download Practice Workbook

You can download the practice workbook from here:


<< Go Back to Discount | Formula List | Learn Excel

Get FREE Advanced Excel Exercises with Solutions!
Meraz Al Nahian
Meraz Al Nahian

Md. Meraz Al Nahian has worked with the ExcelDemy project for over 1.5 years. He wrote 140+ articles for ExcelDemy. He also solved a lot of user problems and worked on dashboards. He is interested in data analysis, advanced Excel, statistics, and dashboards. He also likes to explore various Excel and VBA applications. He completed his graduation in Electrical & Electronic Engineering from Bangladesh University of Engineering & Technology (BUET). He enjoys exploring Excel-related features to gain efficiency... Read Full Bio

We will be happy to hear your thoughts

Leave a reply

Advanced Excel Exercises with Solutions PDF

 

 

ExcelDemy
Logo