+ Reply to Thread
Results 1 to 4 of 4

Vlookup failing when value is a formula

Hybrid View

  1. #1
    Registered User
    Join Date
    08-04-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003,2007
    Posts
    30

    Vlookup failing when value is a formula

    Trying to use Vlookup for some date based calculations.
    I want the dates being used as the Value to be formulas so we don't have to update each date cell when reporting on a new year.

    When the value is text (Date format: d-mmm-yy) it is fine, but it fails if I set the date cell to a concatenate formula.

    The array index uses Date format of d-mm-yyyy and it doesn't matter if I use that format or the d-mmm-yyyy format for the value cell or the vlookup formula cell, so long as it the date is typed in and not entered via a formula.

    The attachment shows the formulas in the Calculations tab.
    The January data does not show due to using a formula to enter the date in B1
    (=CONCATENATE("1/01/",2011))
    The year will actually be in cell A2, so this is more correct for what I'm after: =CONCATENATE("1/01/",$A$2)

    It doesn't seem to be coming in as text, but maybe I'm not reading it right.
    Attached Files Attached Files
    Last edited by Opy; 08-31-2011 at 09:57 PM. Reason: Solved

  2. #2
    Forum Expert teylyn's Avatar
    Join Date
    10-28-2008
    Location
    New Zealand
    MS-Off Ver
    Excel 365 Insider Fast
    Posts
    11,375

    Re: Vlookup failing when value is a formula

    Hello,

    instead of

    =CONCATENATE("1/01/",$A$2)

    use

    =DATE($A$2,1,1)

    Format the cell to your liking with a date format.

    The date formula will return a true date, whereas the concatenate returns a text value, which the Vlookup cannot find in the source data.

    cheers,

  3. #3
    Valued Forum Contributor scottylad2's Avatar
    Join Date
    09-03-2010
    Location
    edinburgh
    MS-Off Ver
    Office 2007 Prof & Office 2010 Student Edition
    Posts
    629

    Re: Vlookup failing when value is a formula

    =DATEVALUE(CONCATENATE("1/01/",A2)) in B1 and in C1 and drag along use EOMONTH(B1,0)+1

    As <="" span="">teylyn says, you willl then need to go in and format as you need
    Last edited by scottylad2; 08-31-2011 at 09:30 PM.
    Windows 7 using Office 2007 & 2010

    Remember your [ code ] [ /code ] tags, makes reading soooo much easier

  4. #4
    Registered User
    Join Date
    08-04-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003,2007
    Posts
    30

    Re: Vlookup failing when value is a formula

    Thank you both.
    I went with Teylyn's option as this will be easier to program into the macros that update the workbook.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1