Featured
- Get link
- X
- Other Apps
If Statement With Another Function In Excel
IF statement with another function
IF statements can also force additional calculations to be performed if a certain condition is met. Here we're going to evaluate a cell to see if Sales Tax should be charged, and calculate if the condition is true.
1. In cell F33, we've entered =IF(E33 = "Yes", F3 1*SalesTax,0), where we set up SalesTax as a Named Range with a value of 0.0825. Our formula says If cell E33 equals Yes, then multiply cell F31 times SalesTax, otherwise return a 0.
Try changing Yes to No in cell E33 to see the calculation change.
2. Next we've added an IF statement to calculate shipping if it's required. In cell F35 you'll see =IF(E35="Yes",SUM (D28:D29)*1.25,0). This says "if cell E35 is Yes, then take the sum of the Quantity column in the table above, and multiply it by 1.25, otherwise return a 0".
3. Next, change the 1.25 in the formula in cell F35 to "Shipping". As you start typing, Excel auto-correct, should find it for you. When it does, press Tab to enter it. This is a Named Range, and we entered it from Formulas Define Name. Now, if you ever need to change your shipping cost, you only have to do it in one place, and you can use the Shipping name anywhere in the workbook.
Comments
Post a Comment