##### Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

# Make a Month Equal a number

1

I want to make a word equal a number. This way when I click on the word while entering a formula in another cell, it will calculate with a number not the word.

I want January to equal 1, February to equal 2, March to equal 3, April to equal 4, May to equal 5, June to equal 6, July to equal 7, August to equal 8, September to equal 9, October to equal 10, November to equal 11, and December to equal 12.

Post Edited
Tags: Tags were updated to reflect the topic of the question.

1

This formula will do the job.

``=IFERROR(MONTH(DATEVALUE(\$A2 & " 1")),0)``

In this formula, A2 holds the written name of the month. If it doesn't an error occurs which the formula will catch and return zero.

And this is how it works:-
=DATEVALUE("January 1") returns a valid date (in the current year) from which the MONTH() function extracts the month's number.