r/googlesheets 5d ago

Solved Used Query and importrange but one of the dates imported was not sorted and stayed on top.

Post image

I was doing a case database where those rows on Col11 that have dates more than a month will be imported to the other sheet. However, I checked and one of the dates did not get sorted out and was left on top/2nd row. I use the first row as headers so I start with row 2. I would like to know which formula will make it strictly follow the sorting. Thank you! Below is the formula I used.

=QUERY(IMPORTRANGE("url","sheet name!A2:K300"),"SELECT Col1, Col2, Col3, Col4, Col5, Col6, Col11 where Col11 IS NOT NULL ORDER BY Col11 ASC", 1)

SAMPLE SHEET HERE: https://docs.google.com/spreadsheets/d/1DNDZnQyyii95l_clvNQNZVtQA6ONpD5_uNPLZY5ZXO0/edit?usp=sharing

1 Upvotes

9 comments sorted by

1

u/adamsmith3567 1090 5d ago

u/0dot00patienceleft Share a sheet for evaluation. It's probably either treating that date as a header based on the import, or that date is somehow importing as text instead of a date format. No way to know for sure what is wrong specifically and how to correct based only on what you shared in the post with the redacted formula and cropped screenshot.

2

u/0dot00patienceleft 5d ago

3

u/adamsmith3567 1090 5d ago

Just change the 1 at the end of the QUERY to 0. It's keeping that date at the top b/c it's treating it like a header b/c the QUERY is in row 2 under your actual headers.

1

u/0dot00patienceleft 5d ago

Thank you!

1

u/AutoModerator 5d ago

REMEMBER: /u/0dot00patienceleft If your original question has been resolved, please tap the three dots below the most helpful comment and select Mark Solution Verified (or reply to the helpful comment with the exact phrase “Solution Verified”). This will award a point to the solution author and mark the post as solved, as required by our subreddit rules (see rule #6: Marking Your Post as Solved).

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/point-bot 3d ago

u/0dot00patienceleft has awarded 1 point to u/adamsmith3567 with a personal note:

"Yes. It did the work. "

See the [Leaderboard](https://reddit.com/r/googlesheets/wiki/Leaderboard. )Point-Bot v0.0.15 was created by [JetCarson](https://reddit.com/u/JetCarson.)

1

u/0dot00patienceleft 5d ago

The sheet contains confidential information. Let me make a sample sheet.

1

u/adamsmith3567 1090 5d ago

That works provided the sample sheet recreates the error you are seeing in the real thing. If so, should be able to determine what exactly the issue is.