Map PVC Socket Sizes in Excel with IFS, SWITCH, or XLOOKUP
Question details
Return a corresponding value for each PVC socket size in an Excel worksheet.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- A worksheet contains multiple PVC socket sizes that need to be mapped to specific values.
- Observed behavior
- An IFS formula needs a complete condition and result pair for each size to return the intended value.
Check how socket sizes are stored in the worksheet, including spaces and units, and decide which value each size should return. The examples use text sizes and illustrative values, not PVC specifications; replace them with your actual mappings.
Use complete IFS pairs for each socket size
Use IFS when you want to list each size and its result directly in one formula.
Enter a text size such as 1/2 in in cell A2. Make sure the text matches the size used in the formula.
In B2, enter =IFS(A2="1/2 in",10,A2="3/4 in",15,A2="1 in",20,TRUE,"Not found"). Each condition is followed by its result; the final TRUE pair handles unmatched sizes.
Replace the example sizes and numbers with your own, then drag B2's fill handle down to apply the formula to other rows.

Use SWITCH for exact socket-size matches
Use SWITCH to compare one cell with a short list of exact size values.
Use XLOOKUP with a socket-size lookup table
Use a lookup table when you expect to add or update socket-size mappings.
Map PVC Socket Sizes with WPS Spreadsheets
Use a nested IF formula in WPS Spreadsheets to return a value for each socket size, then save the workbook in Excel format.
- 1. Open the workbook: Open WPS Office, select Spreadsheets, and open your workbook or create a new one.
- 2. Enter a socket size: Enter a text size such as 1/2 in in cell A2. Replace the example with the size format used in your worksheet.
- 3. Add the mapping formula: In B2, enter =IF(A2="1/2 in",10,IF(A2="3/4 in",15,IF(A2="1 in",20,"Not found"))). Replace the example sizes and results with your actual mappings.
- 4. Fill and save: Drag B2's fill handle down for the remaining rows, then use File > Save As to save the workbook as an XLSX file.

Frequently Asked Questions
Why does my IFS formula return an argument error?
IFS requires a result after every condition. Check the formula in the formula bar to ensure each condition has a matching result, including any final TRUE condition.
How can I show a message when a socket size is not listed?
Add TRUE,"Not found" as the final IFS pair, use "Not found" as the final SWITCH argument, or enter it as XLOOKUP's fourth argument.
Why does my socket size not match the lookup table?
Check the source cell and lookup table for differences in spaces, units, or whether the size is stored as text or a number. The examples require text such as 1/2 in to match the table entry.
What if Excel rejects the commas in my formula?
Your regional settings may require semicolons as formula argument separators. Replace the commas between arguments with semicolons and use the appropriate decimal separator for any decimal values.
Can I use XLOOKUP in Excel 2019?
No. XLOOKUP is not available in Excel 2019. Use IFS or SWITCH for a short list of mappings, or use another supported lookup function with a table.




