Home > Uncategorized > Excel Function to Convert a Date to the Month

Excel Function to Convert a Date to the Month

Today I was attempting to pull a PPC report for historical by month over the last three years and wanted to easily convert the date into a month format so that i could show the YoY trendlines for each full calendar year as a unique line within the chart. It frustrates me that Excel only has a function that converts a date to a number that represents the month. Below is a the quick and dirty XLS formula to take that number representation and convert it to the actual month name.

Access a Notepad++ Version of the XLS code here.

Replace B1 in the example with the date based reference cell and voila!


=IF(MONTH(B1)=1,"January",IF(MONTH(B1)=2,"February",IF(MONTH(B1)=3,"March",IF(MONTH(B1)=4,"April",IF(MONTH(B1)=5,"May",IF(MONTH(B1)=6,"June",IF(MONTH(B1)=7,"July",IF(MONTH(B1)=8,"August",IF(MONTH(B1)=9,"September",IF(MONTH(B1)=10,"October",IF(MONTH(B1)=11,"November","December")))))))))))

Happy chart making Thursday to you!

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: