How to Use Different Excel Formulas Based on Another Cell's Value
Question details
The user needs to apply different calculation formulas in a cell depending on a specific text value or category found in another cell.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Calculating dynamic outputs where the required mathematical formula changes based on categorical data (such as offer types) in an adjacent column.
- Observed behavior
- The target cell dynamically returns the result of a specific calculation that matches the condition specified in the reference cell.
Ensure that the reference column containing the conditions (e.g., offer types) has consistent spelling and no hidden trailing spaces, as formula matching is text-sensitive.
Use the IFS Function for Multiple Conditions
The IFS function evaluates multiple conditions in order and applies the corresponding calculation for the first true condition, making it ideal for handling many different scenarios.
The IFS function is cleaner and easier to read than nested IF statements, especially when you have many different categories (like 7 or 8 offer types). It processes logical tests in the order they appear and stops once it finds a match.
Click on the cell where you want the dynamic calculation result to appear (e.g., cell R3).
Type the beginning of the IFS formula: =IFS(
Input your first logical test and its corresponding mathematical formula. For example: I3="Bet 365 - 2 UP", L3*M3+N3
Separate the next conditions with a comma and add the remaining formulas, such as: , I3="Bet 365 - Bore Draw", N3
Close the bracket to finish the formula. For example: =IFS(I3="Bet 365 - 2 UP", L3*M3+N3, I3="Bet 365 - Bore Draw", N3). Press Enter, then drag the fill handle down to apply this logic to the rest of the column.

Use Nested IF Functions for Older Versions
If you are using an older version of Excel that does not support the IFS function, you can nest multiple IF functions together to achieve the same result.
Easily Handle Complex Formulas with WPS Spreadsheet
WPS Spreadsheet fully supports advanced logical functions like IFS and nested IFs, allowing you to effortlessly manage dynamic calculations based on cell values without syntax errors.
- 1. Open your file: Launch WPS Spreadsheet and open your workbook containing the conditional data.
- 2. Enter the IFS formula: Select the target cell, type your =IFS() formula defining each cell value and its respective calculation.
- 3. Drag to fill: Double-click or drag the fill handle at the bottom-right of the cell to apply the dynamic calculations to the entire column.

Frequently Asked Questions
Why does my IFS formula return an #N/A error?
An #N/A error occurs in an IFS formula when none of the specified conditions are met. To fix this, you can add TRUE as the final logical test, followed by the value you want to return (e.g., TRUE, "Not Found"). This acts as a catch-all for any unmatched conditions.
Can I use wildcard characters like an asterisk (*) in the IFS function?
No, the IFS function does not directly support wildcards for text matching. If you need to trigger a calculation based on partial text within a cell, you must combine the IFS function with the SEARCH and ISNUMBER functions.
Is there a limit to how many conditions I can test with IFS?
Yes, the IFS function allows you to test up to 127 different conditions. However, if you find yourself writing a formula with dozens of conditions, creating a reference table and using the VLOOKUP or XLOOKUP function is usually much more efficient and easier to update.




