The month of May in a vlookup table

davidam

Active Member
Joined
May 28, 2010
Messages
497
Office Version
  1. 2021
Platform
  1. Windows
Hello All,
I am using a vLookup table that includes the 12 months in 3 letter format in one column and then the corresponding Month number is the next column. It works fine except for the month of May.
'May' does not appear on any reserved word list. I have a combo box that draws from the column in the vlookup table and I can rectify the problem by adding a space at the end of the word.
I would really like to know what is going on here if anyone knows.
Thanks,
David
 

Excel Facts

Control Word Wrap
Press Alt+Enter to move to a new row in a cell. Lets you control where the words wrap.
Hi David, if you are just looking up on 3 letter month only, in this case May, then you might want to try the TRIM function within VLOOKUP which will fix any space issues that the lookup cell of May might have;

=VLOOKUP(TRIM(May), Range, 1 (Assuming The 3 Letter Months Are In First Column), FALSE.
 
Upvote 1
Solution
Hi Nick,
Thank you for this, it is a very good suggestion. However, I just found that I had made an error with declaring the variable type. In typical VB fashion it worked for every other month but just didn't know what to do with the month of May. I think I will be using the TRIM function going forward though. Thanks again for your reply. This is what keeps this site as valuable as it is.
David
 
Upvote 0
Are you just trying to get the month number from the 3 letter month name? This can be done without a lookup table.

Book2
KL
1Jan1
2Feb2
3Mar3
4Apr4
5May5
6Jun6
7Jul7
8Aug8
9Sep9
10Oct10
11Nov11
12Dec12
Sheet1
Cell Formulas
RangeFormula
L1:L12L1=MONTH(--(K1&" 1, 2001"))
 
Upvote 1
I think I will be using the TRIM function going forward though. Thanks again for your reply. This is what keeps this site as valuable as it is.
The marked solution has been changed accordingly. In your future questions, please mark the post as the solution that actually answered your question, instead of your feedback message as it will help future readers. No further action is required for this thread.
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,161
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top