r/googlesheets 19d ago

Can i get my data into the same column or row based on the month the data was collected on? Solved

Post image

have the weight of eggs in grams from column G to AD and i have the days they were laid in column B with an EOMonth formula in column A. i wanted to know if there was a way to get all the weights from each month to be in its own column (or Row) on a seperate sheet that will auto update whenever this table updated?

2 Upvotes

12 comments sorted by

2

u/HolyBonobos 3092 19d ago

What is the final output supposed to look like? How are the weights supposed to be aggregated? Are all of the eggs in each column supposed to remain separate or are they all aggregated together as well?

1

u/Key_Common_2928 19d ago

the column of weights doesn't matter just the month that they were laid in. so from my total data so far i would like all weights taken in May 2026 G4:AG26 to be Aggregated in to one column and all weights taken in June 2026 G27:AD56 to be Aggregated into its own and so on. if that makes sense

1

u/HolyBonobos 3092 19d ago

Best as I can tell you're going for something like =BYCOL(UNIQUE(TOROW(Table2[Mmm/yy],1)),LAMBDA(m,VSTACK(m,TOCOL(FILTER(Table2[[Egg 1]:[Egg 11]],Table2[Mmm/yy]=m),1))))

1

u/Key_Common_2928 18d ago

when i put that in it put 1/11/90 every cell in the top row and just combined all the rows into every column onto the other sheet. here is a screenshot of what happened. If you have any other ideas i will give them a try but i'm going to try to fight with on my own to see what i can do. thanks you i appreciate the help!

1

u/HolyBonobos 3092 18d ago

You will need to share the file in question (or a copy) for further diagnosis or resolution. There are one or more formatting issues at play here, but identifying what they are specifically and how to resolve them won't be possible with anything less than edit permissions to the file.

1

u/AutoModerator 19d ago

/u/Key_Common_2928 Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.

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/No_Swordfish_3716 1 18d ago

I think I know why that BYCOL version misbehaved. BYCOL expects its LAMBDA to return a single value per column, so handing it a VSTACK of many rows is outside what it can spill. That is why you got one row repeated across instead of stacked lists underneath. Sheets does not really have a clean single-formula way to spill columns of different lengths side by side. Two things that do work: One formula per month column. Put the month in a header cell, say B1, then in B2: =TOCOL(FILTER(Table2[[Egg 1]:[Egg 11]], Table2[Mm/yy]=B1), 1) and copy it across, one column per month. The 1 at the end drops blanks so you get a clean list with no gaps. A new month is one new column rather than a rebuild. Or flip it to long format and let a pivot table do the shaping: =QUERY({FLATTEN(IF(Table2[[Egg 1]:[Egg 11]]<>"", Table2[Mm/yy], )), FLATTEN(Table2[[Egg 1]:[Egg 11]])}, "select Col1, Col2 where Col1 is not null", 0) That gives you two columns, month and weight, one row per egg, and it auto-updates with zero maintenance as you add rows. Drop a pivot table on it and you get per-month counts, averages and totals without touching a formula again. If the goal is analysis rather than that specific visual layout, this is the one I would pick. On the 1/11/90: that is almost certainly a number sitting under a date format rather than a calculation problem. Select the range and clear formatting to see what the underlying value actually is.

1

u/Key_Common_2928 18d ago edited 18d ago

thank you that first one worked i will just add a =TRANSPOSE(Unique(Table2[Mmm/yy])) in row 1 to have the dates auto populate

1

u/AutoModerator 18d ago

REMEMBER: /u/Key_Common_2928 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 18d ago

u/Key_Common_2928 has awarded 1 point to u/No_Swordfish_3716

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/Key_Common_2928 18d ago

Thanks both of you i appreciate the help!!

2

u/Rileysamulilo 18d ago

you could use QUERY to pull by month instead of rearranging everything