How to Export Microsoft Forms Answers as Numeric Codes in Excel
Question details
The user needs a way to translate text-based multiple-choice responses exported from Microsoft Forms into numeric values (such as 1, 2, 3) for statistical analysis.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Preparing survey data exported from Microsoft Forms for analysis in Excel, SPSS, or other statistical software that requires numerical input.
- Observed behavior
- Microsoft Forms automatically exports multiple-choice responses as text labels rather than custom numeric codes.
Ensure you have exported your Microsoft Forms responses and opened the resulting workbook in Excel. Identify exactly which text answers need to be mapped to specific numeric codes before proceeding.
Convert Text Answers to Numeric Codes using XLOOKUP
Create a mapping table and use the XLOOKUP function to automatically translate text responses into numbers.
This is the most reliable method for surveys with many distinct multiple-choice options or complex questionnaires.
In a new worksheet within your Excel file, list all possible text answers in Column A and their corresponding numeric codes (e.g., 1, 2, 3) in Column B.
Return to your main survey data sheet and insert a new blank column immediately to the right of the text answers you want to convert.
In the first cell of your new column, enter the formula: =XLOOKUP(A2, LookupSheet!A:A, LookupSheet!B:B) (Assuming A2 contains your first text response, and 'LookupSheet' is where you created the table).
Select the cell with the formula and drag the fill handle at the bottom right corner down to apply the conversion to all rows in your dataset.

Use the SWITCH Function for Quick Conversions
If you only have a few distinct answers (such as Likert scale options), the SWITCH function lets you convert them directly without needing a separate lookup table.
Use Find and Replace for Direct Swaps
For simple yes/no or true/false datasets, you can directly replace text values with numbers using the built-in Find and Replace tool.
Easily Convert Survey Responses to Numeric Codes in WPS Office
WPS Spreadsheet provides powerful data processing tools, including advanced lookup functions and quick replacement features, to help you seamlessly convert text-based survey exports into numeric codes for statistical analysis.
- 1. Open Survey Export: Launch WPS Office and open the Excel (.xlsx) file downloaded from Microsoft Forms.
- 2. Create a Reference Table: In a new worksheet, type your text answers in column A and their corresponding numeric codes in column B.
- 3. Apply Lookup Function: Insert a new column next to your data and use the =XLOOKUP() function to reference your mapping table.
- 4. Convert Instantly: Drag the formula down to automatically convert all text responses into numeric codes across your entire dataset.

Frequently Asked Questions
Can Microsoft Forms directly export multiple-choice answers as numbers?
No, Microsoft Forms natively exports the exact text labels of multiple-choice answers. You must use spreadsheet functions to convert them into numbers after exporting.
What is the fastest way to convert 'Yes/No' answers to '1/0' in Excel?
The quickest method is to highlight the column and use the Find and Replace feature (Ctrl + H). Set 'Yes' to be replaced by 1, click Replace All, and then repeat for 'No' to 0.
Why is my VLOOKUP formula returning an #N/A error when converting text?
This error typically occurs if there are hidden trailing spaces in your survey text responses or a typo in your lookup table. Use the TRIM function or ensure your lookup table exactly matches the text formatting from Microsoft Forms.




