Vlookup not showing correct values

Hello,

I swear this is a bug, but if anyone can prove me otherwise, I’ll be very impressed.

I am trying to create a basic timesheet: Select the month and year, the sheet updates the days in that month, and then tells you if you try enter a worked day on a weekend or holiday. Since there’s no automatic way to convert month names to numbers, I use Vlookup on a separate sheet (called DATA). It’s wonky and I can’t see the problem.

This is the use case:

  1. I select the month (January, February,…) from a data validation dropdown. I use the same month column as in the vlookup range for this, but I’ve also used a list of months, and the problem remains the same.

  2. To convert this month to a number, I use this on a separate sheet:
    =VLOOKUP($Timesheet.G1,A2:B13,2)

But this simply doesn’t work. July shows the month number as 2:

Screenshot1

(Note that it works perfectly up to June.)
August shows the month number as #N/A. November shows 8 - and so on.

Anyone have any idea?

You don’t need to ignore the fourth parameter - specify 0.
=VLOOKUP($Timesheet.G1;A2:B13;2;0)

Help: When this parameter is TRUE or not given, the first column in the array must be sorted in ascending order.

2 Likes

That’s incredible. You are my greatest hero.

I read this in the popup help:

image

It’s the ‘if the value is not given’ which got me - normally defaults work fine for me. I think I’ll read the proper docs now.

That’s the last time I ignore the fourth parameter :innocent: