+ Reply to Thread
Results 1 to 13 of 13

Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

  1. #1
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    hi all..

    this formula working well with /for full date format.
    i want to modified how to make formula work with format date as month & year
    Please Login or Register  to view this content.
    cause my date as complete/full format (mm-dd-yyyy).
    my question how to display data with criteria date e.g. = 12-2001 (mm-yyyy)

    for someone helping me, thank you so much..

    john m
    Attached Images Attached Images
    Last edited by Jhon Mustofa; 11-24-2021 at 11:19 AM.

  2. #2
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    It would be better if you post the link to your sample Sheet.

  3. #3
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    hi Haluk
    this link https://docs.google.com/spreadsheets...it?usp=sharing
    how to make query date =12/2020 (mm/yyyy) not include day (dd) just mm/yyyy

  4. #4
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    The date in cell D2 of the tab "Query Function" is formatted as "mm/yyyy". You will just enter the value as 12/2000 or 05/2001 or 7/1998 ..... so on

    Check your sheet and see the formula in cell D6

    The formula used is;

    Please Login or Register  to view this content.
    Last edited by Haluk; 11-24-2021 at 01:44 PM.

  5. #5
    Forum Contributor
    Join Date
    12-17-2013
    Location
    ON, Canada
    MS-Off Ver
    MS 365
    Posts
    171

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    Is it the date in cell D2 or the Launch dates in column E that you are trying to format?

  6. #6
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    thank you, worked well

  7. #7
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    where the "date" in G2 is actually a text string styled as 10-1985

    place this formula in cell G6:
    Please Login or Register  to view this content.
    OR:
    Please Login or Register  to view this content.
    Last edited by janmorris; 11-24-2021 at 07:46 PM.

  8. #8
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    how is date in G2=10-1985 or 10/1985

  9. #9
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    10-1985 or 10/1985 can be formatted as a text string, so it is not actually a date.
    elements of the text string can be extracted.

  10. #10
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    You can use this formula as well to get the records, where the "Month" and "Year" values of the data is equal to the "Month" and "Year" of the date string in cell H2, where the date in cell H2 is actually a plain text and can be entered as 10-1985 or 10/1985

    The formula in cell G6 is;

    Please Login or Register  to view this content.
    You can see this in your sheet.



    Edit:

    A more compact solution is to use the following formula to get the records, where the "Month" and "Year" values of the data is equal to the "Month" and "Year" of the date string in cell K2, where the date in cell K2 is actually a plain text and can be entered as 10-1985 or 10/1985

    Please Login or Register  to view this content.
    You can see this in your sheet as well.
    Last edited by Haluk; 11-25-2021 at 03:12 AM.

  11. #11
    Forum Contributor
    Join Date
    01-22-2013
    Location
    Pekanbaru, Indonesia
    MS-Off Ver
    Excel 2013 & Google Sheet
    Posts
    1,146

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    hi.
    another option, if input date as "real date" not Plain Text eg. 12/10/1985
    Please Login or Register  to view this content.
    i have change "< date" with "= date" why not working?

  12. #12
    Valued Forum Contributor janmorris's Avatar
    Join Date
    07-24-2021
    Location
    Japan
    MS-Off Ver
    Google Sheets (& Mac 2021)
    Posts
    1,066

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    the formula is not returning any error so it is working as it is coded.

    perhaps you can explain what results you are looking for.

  13. #13
    Valued Forum Contributor Haluk's Avatar
    Join Date
    02-14-2019
    Location
    Turkiye
    MS-Off Ver
    2010 - 64 Bit on Windows-11 (22 H2) 64 Bit
    Posts
    1,147

    Re: Google Sheet : Query Formula Based On Date (Only format mm-yyyy)

    The formula in cell J6 works for dates in the form of "mm/dd/yyyy" such as "4/12/1985" in cell K2 as well.

    You can use "=" , ">=", "<" operators to fetch the desired results.
    Last edited by Haluk; 11-25-2021 at 09:25 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Update Date Field From User Form in dd/mm/yyyy format instead of mm/dd/yyyy format
    By LUCKY92 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 08-18-2020, 12:11 PM
  2. [SOLVED] How to query by date format yyyy-mm-dd?
    By AccountingJ in forum Access Tables & Databases
    Replies: 4
    Last Post: 05-14-2020, 12:14 PM
  3. Replies: 3
    Last Post: 04-25-2019, 11:05 AM
  4. Convert Date format from Text format reading m/d/yyyy to dd/mm/yyyy
    By bridge4444 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 11-23-2017, 11:22 PM
  5. Replies: 7
    Last Post: 11-18-2012, 02:28 PM
  6. [SOLVED] Imported data contains strings dd.mm.yyyy how can I convert to date format dd/mm/yyyy inVB
    By Boormo in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 09-05-2012, 05:48 PM
  7. opening excel file -> date format problem: DD/MM/YYYY vs MM/DD/YYYY
    By yung in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-18-2005, 09:06 AM

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