Function Problems

Excel Formula for Premiums: Using IF, AND, or INDEX MATCH

Anum MushtaqAnum Mushtaq Nov 10, 2026 869 views

Question details

The user needs to create an Excel formula that calculates the correct premium amount based on two simultaneous conditions: the selected plan and the pet type.

How to Calculate Premiums Based on Multiple Criteria in Excel
Product
Excel
Device & OS
not provided
Scenario
Determining an insurance or service premium rate where the final price depends on a combination of user selections across multiple variables.
Observed behavior
Users frequently attempt to write excessively long, nested IF and AND statements, resulting in formulas that are difficult to manage, error-prone, and hard to update.
Before you start

Ensure your lookup data (plans, pet types, and corresponding premium rates) is organized in a clear, structured table. It is highly recommended to place your reference grid in a separate range or sheet to keep your primary calculator clean.

Solution 1Recommended

Build a Two-Way Lookup Using INDEX and MATCH

Instead of writing a complex nested IF formula, using an INDEX and MATCH combination performs a two-way lookup that is far more efficient for finding a value based on row and column intersections.

When dealing with multiple variables (such as checking both 'Plan Type' and 'Pet Type' simultaneously), an INDEX and MATCH formula searches horizontally and vertically to pinpoint the exact value in a grid.

This method separates data from logic. If your premium rates change in the future, you only need to update the values in your table without modifying the formula.

1
Organize your data grid

Set up a table where cells A6:A9 contain the plan names, cells B5:C5 contain the pet types (e.g., Dog, Cat), and cells B6:C9 contain the actual premium values.

2
Set up the input selection cells

Dedicate cells for data entry. For example, use cell A2 for typing or selecting the chosen plan and cell B2 for the chosen pet type.

3
Enter the lookup formula

Select your result cell, type =INDEX($B$6:$C$9,MATCH(A2,$A$6:$A$9,0),MATCH(B2,$B$5:$C$5,0)), and press Enter. This extracts the exact premium located at the intersection of the matching plan row and pet type column.

Build a Two-Way Lookup Using INDEX and MATCH
Formula Efficiency: Using absolute references (with the $ symbol) ensures your lookup range stays locked if you need to drag and copy the calculation down to other rows.
Boost Your Spreadsheet Productivity

Effortlessly Handle Complex Formulas in WPS Spreadsheet

WPS Spreadsheet offers full support for advanced lookup functions like INDEX and MATCH, allowing you to build dynamic premium calculators with ease. It perfectly mimics the formula logic of Microsoft Excel, ensuring your files work flawlessly.

  1. 1. Open your workbook in WPS: Launch WPS Office and open your .xlsx or .xls file containing your premium lookup data.
  2. 2. Insert your lookup functions: Navigate to the Formulas tab to use 'Insert Function' if you need guidance with syntax, or directly type =INDEX(...MATCH...) into the formula bar.
  3. 3. Calculate your premiums automatically: Enter your references and press Enter to instantly calculate your multi-criteria results with total precision.
100% compatible with Microsoft Excel .xlsx formats and complex formulas.Includes a rich library of functions for data analysis and two-way lookups.Lightweight and fast calculation performance, even on large datasets.Free alternative to handling advanced spreadsheet logic efficiently.
QA img-9

Frequently Asked Questions

Why does my INDEX and MATCH formula return an #N/A error?

An #N/A error means the software cannot find an exact match for your lookup value. Ensure the text in your input cells (like Plan or Pet Type) matches the headers and rows in your lookup table exactly, with no hidden trailing spaces or spelling errors.

Can I use XLOOKUP instead of INDEX and MATCH for two-way lookups?

Yes. If you are using a newer version of Excel or WPS Office, you can nest two XLOOKUP functions to achieve the same result. The syntax involves placing one XLOOKUP inside the return_array of another, like so: =XLOOKUP(A2,$A$6:$A$9,XLOOKUP(B2,$B$5:$C$5,$B$6:$C$9)).

What is the limit for nesting IF functions in Excel?

In modern versions of Excel and WPS Spreadsheet, you can nest up to 64 IF functions in a single cell formula. However, nesting that many functions makes the formula extremely hard to read and debug, which is why table-based lookups (like INDEX/MATCH) are strongly recommended.

Can I use the IFS function instead of nested IF and AND?

Yes, the IFS function lets you test multiple conditions in order without writing 'IF' repeatedly. The syntax looks like this: =IFS(AND(A2="Basic",B2="Dog"), 30, AND(A2="Basic",B2="Cat"), 25...). It evaluates conditions from left to right and stops at the first true statement.