How to Assign Amounts by Service Name Using Formulas in Excel
Question details
The user needs to automatically return or assign a specific monetary amount or numerical value based on a service name entered in a cell.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Assigning varying prices or amounts to different services in a spreadsheet automatically, avoiding manual data entry.
- Observed behavior
- The user wants to dynamically display the correct amount corresponding to a specific service name using an automated formula setup.
Ensure your service names are spelled consistently across your spreadsheet to prevent formula matching errors, and decide whether a short nested formula or a dedicated lookup table better suits the size of your dataset.
Use Nested IF Functions for a Short List of Services
This method is ideal when you only have a small number of service options (typically 3 to 5) to assign amounts to.
The IF function evaluates a condition and returns one value if true and another if false. By nesting multiple IF functions, you can check multiple service names in a single formula.
While easy to set up for a few items, this approach becomes difficult to maintain if your list of services grows.
Click on the cell where you want the assigned amount to be displayed (for example, B2, assuming your service name is in A2).
Type your nested IF formula incorporating your specific services and amounts. For example: =IF(A2="Boss Revolution",38,IF(A2="Vidapay",58,IF(A2="AT&T",50,0)))
Press Enter to execute the formula, then click and drag the fill handle at the bottom-right corner of the cell down to apply the formula to the rest of your list.
Use XLOOKUP with a Data Table for Larger Lists
Creating a dedicated lookup table is the best practice for managing many services, as it is cleaner, scalable, and much easier to maintain over time.
Easily Manage Service Pricing with WPS Spreadsheet
WPS Spreadsheet provides comprehensive support for advanced logical and lookup functions, making it simple to assign amounts based on specific services accurately and efficiently.
- 1. Open your workbook: Launch WPS Spreadsheet and open the document containing your service data.
- 2. Organize your reference table: Set up your list of service names and their corresponding amounts in a clear, two-column table.
- 3. Insert the lookup formula: Select the target cell and type your VLOOKUP or XLOOKUP formula to link your main data with the reference table.
- 4. Apply across your dataset: Press Enter, then use the fill handle to automatically assign amounts to all the remaining services in your list.

Frequently Asked Questions
Why is my formula returning a #N/A error when looking up service names?
A #N/A error usually happens if the service name in your main cell does not perfectly match the name in your lookup table or nested formula. Check for accidental typos, extra spaces, or trailing spaces in both cells.
Is there a limit to how many nested IF functions I can use?
Modern spreadsheet software supports up to 64 nested IF functions. However, for anything more than 3 to 5 conditions, using a lookup table (with VLOOKUP or XLOOKUP) is highly recommended for readability and easier maintenance.
Can I return a blank cell instead of a 0 if the service isn't found?
Yes. In an IF function, replace the final 0 with empty quotes (""). In XLOOKUP, change the 'if_not_found' argument to empty quotes like this: =XLOOKUP(A2, ServiceTable[Service], ServiceTable[Amount], "").





