+ Reply to Thread
Results 1 to 7 of 7

Lookup partial value and return text I define

  1. #1
    Registered User
    Join Date
    03-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    6

    Lookup partial value and return text I define

    I want to do a partial lookup on a cell and then return a text value I set. For example: I have a column of dates such as 1/1/13, 4/12/13, 6/1/13. I want to lookup the first number and then return the corresponding month. So 1/1/13 would return a value of January, 4/12/13 would return April, etc.

    Thanks!

  2. #2
    Valued Forum Contributor loginjmor's Avatar
    Join Date
    01-31-2013
    Location
    Cedar Rapids, Iowa
    MS-Off Ver
    Excel 2013
    Posts
    1,073

    Re: Lookup partial value and return text I define

    Hi -

    You could use the MONTH function to return the number of the month (e.g., 1 for January, 2 for February, etc.). Then use VLOOKUP function to look at a list you have defined with 1 corresponding to the text January and so on.

    Hope that helps.

  3. #3
    Forum Expert dredwolf's Avatar
    Join Date
    10-27-2012
    Location
    Clearwater,Canada
    MS-Off Ver
    Excel 2007
    Posts
    2,649

    Re: Lookup partial value and return text I define

    okay, lets say your dates are in Column A starting Row 2, and you have the month names in say Column Z, starting in Row 2
    This anywhere would return the Month for A2:
    =INDEX($Z$2:$Z$13,MONTH(A2))

    Hope this helps
    A picture may be worth a thousand words, BUT, a sample Workbook is worth a thousand screenshots!
    -Add a File - click advanced (next to quick post), scroll to manage attachments, click, select add files, click select files, select file, click upload, when file shows up at bottom left, click done (bottom right), click submit
    -To mark thread Solved- go top of thread,click Thread Tools,click Mark as Solved
    If you received helpful response, please remember to hit the * of that post

  4. #4
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup partial value and return text I define

    Try this...

    A1 = some date

    This formula will return the long month name:

    =TEXT(A1,"mmmm")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  5. #5
    Registered User
    Join Date
    03-10-2013
    Location
    Portland, OR
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Lookup partial value and return text I define

    The TEXT function works but if the cell is blank it's still returning January as a month value. It should contain nothing in the cell.

  6. #6
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Lookup partial value and return text I define

    =IF(A1<>0, TEXT(A1,"mmmm") ,"")
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

  7. #7
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookup partial value and return text I define

    Try this...

    =IF(N(A1),TEXT(A1,"mmmm"),"")

+ 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