what is the best worksheet function to...

  • Thread starter Thread starter dkholmes50
  • Start date Start date
D

dkholmes50

I have populated many cells in column A with the numbers 1 through 12. The
numbers are synonymous with the months of the year. However, I would like to
enter a formula in a cell in column B that looks at a cell in Column A,
determines which number is the cell and then populate the actual month in a
cell in column B. So if the number 12 was in cell A250, I would like the
formula B250 to look at cell A250, identify that it is populated with the
number 12 and then populate cell B250 with the word December. I would like to
run the formula on the entire list in Column A. So theoretically, each month
will appear in Column B because of the list of numbers 1 through 12 in column
A. How do I do this?
 
I am sure there are easier ways, but here are 2 ways that work:

=IF(AND(A2>=1,A2<=12,A2=INT(A2)),TEXT(A2&", 2008","mmmm"))

or if you are really a glutton for punishment.
(you could add the same error handling as in the IF statement above).
=CHOOSE(A2,"January","February","March","April","May",June","July","August","September","October","November","December")
 
List the months of the year for example in M1:M12 like this:

January
February
March
etc

Then in B250 you can use this formula:

=INDEX(M$1:M$12,A250)

If you want error handling you could use:

=IF(OR(A250<1,A250>12),"",INDEX(M$1:M$12,A250))

Then just copy that down as required.

Hope this helps.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top