0

I have a list of orders, like this:

Paid    $28.00 | 2019-04-08 15:14:20
Unpaid  $00.00 | 2019-04-08 15:13:48
Unpaid  $00.00 | 2019-04-08 15:12:58
Unpaid  $00.00 | 2019-04-08 15:12:10
Paid    $18.00 | 2019-04-08 14:14:20
Paid    $18.00 | 2019-04-08 13:13:48
Paid    $58.00 | 2019-04-08 13:12:58
Unpaid  $00.00 | 2019-04-08 12:12:10

I want to turn them into numbers by hour, like this:

Date/Time     | Total | Paid | Total 
2019-04-08 12 | 0     | 1   | 1
2019-04-08 13 | 76    | 2   | 2
2019-04-08 14 | 18    | 1   | 1 
2019-04-08 15 | 28    | 1   | 4
  • What have you tried? Where are you stuck specifically? – Jan Doggen Apr 8 at 9:57
0

=ARRAYFORMULA({"Date/Time", "Total", "Paid", "Total"; 
 {QUERY({LEFT(B1:B, 13), IFERROR(SPLIT(A1:A, " "))}, 
 "select Col1,sum(Col3),count(Col1) 
  where Col2 matches 'Paid' 
  group by Col1 
  label sum(Col3)'',count(Col1)''", 0),
 VLOOKUP(QUERY(QUERY({LEFT(B1:B, 13), IFERROR(SPLIT(A1:A, " "))}, 
 "select Col1,sum(Col3),count(Col1) 
  where Col2 matches 'Paid' 
  group by Col1", 0),
 "select Col1"),
 QUERY({LEFT(B1:B, 13), IFERROR(SPLIT(A1:A, " "))},
 "select Col1,count(Col1) 
  where Col1 is not null 
  group by Col1", 0), 2, 0)}})

0

  • 1
    That's what I want. Thanks! – darkrose1977 Apr 9 at 8:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.