0

I'm looking for an easy way to account my son's food intake. The trouble is, all of the forms we've used to date are arduous when trying to collect data straight into spreadsheets. So I thought we could use an IFTT/Do button.

A couple problems I need help with:

  1. IFTTT inputs the data as text: how do I use the DATE function to reformat the cell data for each date?
  2. The "button" we're using represents 30 mL of milk but in a single meal he may eat much more - so we're pressing the button multiple times. What array formula can I use to add all formula for each day?

Here's a link to a sample spreadsheet so far. https://docs.google.com/spreadsheets/d/1ds_IvgS5JWuFmsEipk-wUcsfGQVSVD1tXPydDCoT7Xo/edit?usp=sharing

tehhowch
  • 9,645
  • 4
  • 24
  • 42
  • You should provide the required information in the question, not solely in links (e.g. an example input from IFTTT). Tried anything? Seems you want to "sum if"... – tehhowch Aug 13 '18 at 01:02

1 Answers1

0

I hope you enjoy this special time. I would leave column A alone, probably you get no control on that. But for column B, if you get to, I follow your lead on the condition, but I would want numbers for the results so I can do math on them, so =ARRAYFORMULA(if(A2:A>"0",30,0))

I introduced a column C for Dates and a Column D for times and did the following in C2 to get them:

=arrayformula(if(isblank(A2:A),"",SPLIT(A2:A," at ",false))).

To make these look nice, I formatted the respective columns as dates and times.

In column E I wanted the various dates, so I wrote in E2,

=unique(C2:C)

Then to get the sums per date I had had a really gross QUERY for SUM(B) where C = Date..., and then I saw the comment with the sumif idea. So in F2 you can put the following and drag down as needed:

=sumif(C2:C,E2,B2:B)

and you have your totals by day.

Jeremy Kahan
  • 3,796
  • 1
  • 10
  • 23
  • Thank you so much, your advice is really helpful and gives me a good starting point for a lot more learning. So I've implemented your formulas across the table and it seems to be working really well except for one error (I've highlighted it in the spreadsheet too). It seems that the "sum if" formula produces correct results except for the Aug 12 date. I'm not sure why that might be the case. Secondly, is it possible to turn that "sumif" formula in to an array - I suspect I'm going to quickly run out of rows weekly given the 30ml increments. – SheetsNoob Aug 16 '18 at 16:48
  • You have entries for August 12th hiding on line 1006-1009 – Jeremy Kahan Aug 16 '18 at 20:00
  • I do not have time to think hard about it now, but see https://stackoverflow.com/questions/30081491/google-sheets-arrayformula-with-sumifs for an example of doing arrayformula on sumif. In this case my naive, untested belief is =arrayformula(sumif(C2:C,E2,B2:B)) should work. – Jeremy Kahan Aug 16 '18 at 20:05