+ Reply to Thread
Results 1 to 6 of 6

Month from a range of dates

  1. #1
    Registered User
    Join Date
    05-20-2010
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    11

    Month from a range of dates

    I need some help with this. What I'm trying to do is this: I have two columns of info, one has the actual ship date and the other has the ship month. The problem that I'm having is that the ship month doesn't correspond with the actual date. For example, Our ship month for June ranges from June 13th to July 11th. So the cell that has the ship date would be entered like this: 7/4/10 and I want the other cell to show the actual ship month of June.

    Is there a way to have a cell populate a month based on the range of dates that are entered.

    Thanks
    Last edited by awdms6; 06-11-2010 at 04:51 PM.

  2. #2
    Forum Expert Bob Phillips's Avatar
    Join Date
    09-03-2005
    Location
    Wessex
    MS-Off Ver
    Office 2003, 2010, 2013, 2016, 365
    Posts
    3,284

    Re: Month from a range of dates

    Okay, that is fine for June, but what are the ship dates for July. Obviously 12th July, but Agust the what, 11th, 12th? You need some hard and fast rule.

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

    Re: Month from a range of dates

    See if this works for you. You'll need to make a table with the first column being the initial date for that shipping month (i.e. 6/13/2010) and the second column being the shipping month. Then use a VLookup

    =VLOOKUP(A5,$J$3:$K$14,2)

    Does that work for you?
    Attached Files Attached Files
    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

  4. #4
    Registered User
    Join Date
    05-20-2010
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Month from a range of dates

    Quote Originally Posted by Bob Phillips View Post
    Okay, that is fine for June, but what are the ship dates for July. Obviously 12th July, but Agust the what, 11th, 12th? You need some hard and fast rule.

    Yeah I wanted someone to commit to a rule but the dates are determined by someone with a better office than me (if you know what I mean).

    ChemistB's formula seems like it is what I need though.

  5. #5
    Registered User
    Join Date
    05-20-2010
    Location
    Florida
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Month from a range of dates

    Quote Originally Posted by ChemistB View Post
    See if this works for you. You'll need to make a table with the first column being the initial date for that shipping month (i.e. 6/13/2010) and the second column being the shipping month. Then use a VLookup

    =VLOOKUP(A5,$J$3:$K$14,2)

    Does that work for you?
    Thanks a lot, this formula seems like its working just fine.

    So I want to make sure that I learn and understand it, and not just copying your work.

    So the VLOOKUP looks at the data in that first cell ex.A5 then looks vertically from J3 all the way down to see where it fits in and compares that to the vertical row at K down to 14. So what does the 2 represent in the formula.

    Thanks again for your help.

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

    Re: Month from a range of dates

    You have it pretty much correct. What happens is that the formula trys to match the value in A5 to a value in the first column (J) of the table J3:K14. The 2 tells the formula that when it finds a match (without going over), return the value for column 2 (K). Hope that makes sense.

+ 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