+ Reply to Thread
Results 1 to 10 of 10

vllokup formatting problem

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Blackwood, NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    vllokup formatting problem

    Hi, i have a vlookup to a table that is linked to a access db that has both dates and percentages in it. when i do a simple vlookup the data is fine but i cannot do conditional formatting. however, if i change the vlookup to this

    =VLOOKUP($E5,tblCurrent,4,FALSE)*1

    the conditional formatting works but anything that is a date becomes a percentage. so 11/26/13 becomes 4160400%

    i tried using the text function for the last part of the formula but it didn't work

    any ideas?

    thanks

  2. #2
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: vllokup formatting problem

    Hi
    perhaps post a small sample sheet

  3. #3
    Registered User
    Join Date
    02-05-2013
    Location
    Blackwood, NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: vllokup formatting problem

    first time on this forum. not sure how i could post a sample sheet. the file has two tabs. one from access and one i am trying to format

  4. #4
    Registered User
    Join Date
    02-05-2013
    Location
    Blackwood, NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: vllokup formatting problem

    test.xlsx

    tried to attach a file

  5. #5
    Registered User
    Join Date
    02-05-2013
    Location
    Blackwood, NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: vllokup formatting problem

    my belief is that i need to use code to format each cell on the fly depending on if it is percent or date

  6. #6
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: vllokup formatting problem

    have you tried custom formatting the cell with the vlookup in as something like
    [<=100]0.0%;[>100]mm/dd/yyyy;General
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  7. #7
    Registered User
    Join Date
    02-05-2013
    Location
    Blackwood, NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: vllokup formatting problem

    i fixed it. i did a vlookup like this
    =IF(VLOOKUP($E5,tblCurrent,4,FALSE)*1<=1,VLOOKUP($E5,tblCurrent,4,FALSE)*1,VLOOKUP($E5,tblCurrent,4,FALSE))

    so it looks to see if there is a percent, <=1 and times by 1 to make it a number. then if not it just takes the text. works perfectly.

    I do have a different question though. in doing a vlookup instead of counting over columns, can i have it look for specific text?

  8. #8
    Registered User
    Join Date
    02-05-2013
    Location
    Blackwood, NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: vllokup formatting problem

    never mind. i can use index and match. thanks

  9. #9
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,936

    Re: vllokup formatting problem

    Based on your last post it seems that you are satisfied with the solution(s) you've received but you haven't marked your thread as SOLVED. If your problem has not been solved you can use Thread Tools (located above your first post) and choose "Mark this thread as unsolved".
    Thanks.

    Also, as a relatively new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  10. #10
    Registered User
    Join Date
    02-05-2013
    Location
    Blackwood, NJ
    MS-Off Ver
    Excel 2007
    Posts
    8

    Re: vllokup formatting problem

    Thanks for the advise

+ 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