Forum Discussion
SUMIF on Numbers formatted as text
- Jan 11, 2024
Hi again,
Since I have 100's of these I found one way to mass insert an apostrophe is to use the VBA macro option found in this link: https://www.exceldemy.com/add-leading-apostrophe-in-excel/ since it was the only way I could get the prefix apostrophe that is hidden and is flagged as 'Number formatted as text' warning, which I want for XLOOKUPs.
I set the data type back to General, ran the macro on the column, and voila, the SUMIF works.
Thanks to everyone for their help
Sue
- Detlef_LewinJan 11, 2024Silver Contributor
I meant this formula:
SUMIF(Programs[MTCU Code],"4*",Programs[Number Entrants])And the MTCU Codes are not text.
Check with ISTEXT().
- YeahManJan 11, 2024Brass ContributorI don't understand. I've formatted the column as TEXT (highlighted yellow in the picture). If that doesn't work, what do you have to do in Excel to get numeric strings instead of numbers?
- Detlef_LewinJan 11, 2024Silver Contributor
You have to format first and then enter the data.
If you enter data first and format later then you have press F2 and ENTER for each cell.
For a batch of cells in one column:
- Select cells.
- Goto Data -> Text to columns
- On step 3 choose "Text" and ENTER.