+ Reply to Thread
Results 1 to 8 of 8

Find the MONTH in a range when we're provided the entire date

  1. #1
    Forum Contributor
    Join Date
    12-16-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2016 Preview
    Posts
    105

    Find the MONTH in a range when we're provided the entire date

    Someone threw us a curveball.

    This formula was working perfectly

    =IFERROR(LOOKUP(2,1/((OrderIDs=K28)*(IO_Months=E30)),ROW(IO_Months)),0)

    Now we're told that instead of being given the text name of a month, we'll be given an entire numerical date but still have to extract the MONTH info.

    How can the existing formula be modified?

    NOTES
    IO_Months is a named range on a raw data sheet
    Cell E30 (on the main page) currently says "January"
    Cell E31 says "February" ...

    So, the IO_Months range will stop having "January" and will start showing, for example, "1/19/12"
    I was looking for a way to nest the MONTH function in here and haven't figured it out.

    Thanks for your help!
    Last edited by Habanero Time; 01-24-2012 at 09:04 PM.

  2. #2
    Registered User
    Join Date
    09-26-2010
    Location
    A, A
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: Find the MONTH in a range when we're provided the entire date

    Use =text(E30,"mmmm") to get January assuming E30 has 1/19/12 and then use the same formula u were using changing the lookup to the new cell

  3. #3
    Forum Contributor
    Join Date
    12-16-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2016 Preview
    Posts
    105

    Re: Find the MONTH in a range when we're provided the entire date

    Quote Originally Posted by adaws View Post
    Use =text(E30,"mmmm") to get January assuming E30 has 1/19/12
    It's the other way around

    The raw data used to say January. Now it's going to say 1/19/12
    Cell E30 is on the main worksheet and summarizes January activity. Cell E30 will still say January but the formula needs an extra step. It's got to go to the raw data and no longer look for "January"; it's got to look in the range and recognize 1/19/12 as being January.

  4. #4
    Forum Contributor
    Join Date
    12-16-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2016 Preview
    Posts
    105

    Re: Find the MONTH in a range when we're provided the entire date

    I've tried this and it's just results in an error:

    =IFERROR(LOOKUP(2,1/((OrderIDs=K28)*(IO_Months=(MONTH(IO_Months)=1))),ROW(IO_Months)),0)

  5. #5
    Forum Guru
    Join Date
    05-24-2011
    Location
    India
    MS-Off Ver
    Office 2021
    Posts
    2,237

    Re: Find the MONTH in a range when we're provided the entire date

    Hi, try any of this,

    =IFERROR(LOOKUP(2,1/((OrderIDs=K28)*(TEXT(IO_Months,"ddd;;;")="Jan")),IO_Months),0)

    Or with CTRL+SHIFT+ENTER rather than just ENTER

    =MAX(IF(OrderIDs=K28,IO_Months))

    If not can you please attach your dummy file with desired results? So the members can see your requirements.
    Regards,
    Haseeb Avarakkan

    __________________________________
    "Feedback is the breakfast of champions"

  6. #6
    Forum Moderator vlady's Avatar
    Join Date
    09-22-2011
    Location
    Philippines - OLSHCO -Guimba-Nueva Ecija
    MS-Off Ver
    2021
    Posts
    4,361

    Re: Find the MONTH in a range when we're provided the entire date

    Hello
    i think your just getting the value of the month in a date

    =MONTH(VALUE(E30))
    I think people forget the word "THANK YOU!!!!" Do you still know it???

    There is a little star ( ADD REPUTATION ) below those person who helped you. Click it to say your "PRIVATE APPRECIATION TO THEIR EFFORT ON THEIR CONTRIBUTIONS "

    Regards,
    Vladimir

  7. #7
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    2016
    Posts
    14,675

    Re: Find the MONTH in a range when we're provided the entire date

    adaws has the right idea. You can apply TEXT function to the named range IO_Months to pull out the month as text. Try this version


    =IFERROR(LOOKUP(2,1/(OrderIDs=K28)/(TEXT(IO_Months,"mmmm")=E30),ROW(IO_Months)),0)
    Audere est facere

  8. #8
    Forum Contributor
    Join Date
    12-16-2011
    Location
    Portland, OR
    MS-Off Ver
    Excel 2016 Preview
    Posts
    105

    Re: Find the MONTH in a range when we're provided the entire date

    Quote Originally Posted by daddylonglegs View Post
    adaws has the right idea. You can apply TEXT function to the named range IO_Months to pull out the month as text. Try this version


    =IFERROR(LOOKUP(2,1/(OrderIDs=K28)/(TEXT(IO_Months,"mmmm")=E30),ROW(IO_Months)),0)


    That did it! THANKS!

+ 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