0

I have one workbook that has daily tracking of bidding dates and amounts and win day and amounts. In another workbook, I access that information to see the totals per day. Then play with that to see week/month/quarter and year performance. The problem I have is that I can not get my query searches to work in an array manner and have to drag the date driven formulas down 364 times for each column of information and all it's done is create a slow database...

=QUERY(importrange('source addresses'!$B$2,"bid tracker!$a$3:$x"),
"SELECT SUM (Col9) 
WHERE Col8 = date '"&text(B5,"yyyy-mm-dd")&"'
label sum(Col9) ''   ",0)

Col9 = amount of contract
Col8 = date of win

This formula produces a single data output for the sum of that days wins, I need it to array all 365 days to eliminate the other 364 of THESE formulas I am using due to my inexperience.

I have used arrayformula before query and after and every example I see doesn't seem to apply or work for me...

2
  • Share a sample workbook. Commented Dec 22, 2022 at 8:27
  • use BYROW() Commented Dec 22, 2022 at 15:31

1 Answer 1

0

You need group by clause like group by Col8. Try-

=QUERY(importrange('source addresses'!$B$2,"bid tracker!$a$3:$x"), 
"SELECT SUM (Col9) 
WHERE Col8 <= date '"&text(B5,"yyyy-mm-dd")&"' AND Col8 >= date '"&text(B5-369,"yyyy-mm-dd")&
"' group by Col8 label sum(Col9) '' ",0)
Sign up to request clarification or add additional context in comments.

3 Comments

This definitely gave me a lot more data, BUT - It's incorrect and the data stops at row 194 (Should go to row 369). Not sure what it's doing with the data, but it's not correct. This is simplified for one date to compare rather than between multiple dates. =QUERY(importrange('source addresses'!$B$2,"bid tracker!$a$3:$x"), "SELECT SUM (Col9) WHERE Col8 = date '"&text(B5,"yyyy-mm-dd")&"' group by Col8 label sum(Col9) '' ",0) This 'group' function didn't array the data in this formula.
I updated the original post.
group by clause should return 1 record for each date between WHERE clause conditions. Share a sample workbook with few dummy data.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.