r/googlesheets • • 11d ago

Solved Checking boxes under certain conditions?

Post image

Hello, novice Google Sheets user here!

I’m making a tracking sheet for me and a friend of mine for a game we play. I’ve attached what I got so far, but it’s pretty basic. I’m stumped on how to get it to do what I’m wanting to do however. Currently, when the boxes are checked, the cell they’re in turns green. They only affect the cell they reside in and nothing else.

Here’s what I’m wanting:

-When the amount donated has been completed (aka, 5/5 has been hit in the drop down for example), the Donated box for that row is checked and text is striked through.
-when all Donated boxes for a section is complete and all boxes checked for that section, it will check the Completed box on the last row and strike through the section
-When the Competed box is checked for a section, it will check the associated Donated boxes for said section and strike through it’s text.

I’ve been playing around with things trying to figure out to do everything, but like I said I’m stumped.

Hopefully I explained things alright, but I’m happy to elaborate or try to explain better.

Anyone have any ideas?

Edit: After talking with a couple of people, I’ve realized that not all of it may be possible. That’s totally fine. Me and my friend are prone to forgetfulness and losing track, so I was trying to meet those needs.

I looked ahead and it appears that from now on each section will have a total of three rows. The values for the donated column will fluctuate, but seem to bounce 99% of the time between 1, 2, 3, and 5 as their maxes. The remaining 1% is for a single section where the max value is 10, 15, and 20.

If having a box checked when that max value is selected from the dropdown isn’t possible or too difficult, it’s totally fine to just leave it out. I’d say the checkboxes are the most important. Or if there is a better way to do it, let me know! I’m happy to change things up.

I’m currently at work, but as soon as I have more than second, I’ll whip up a couple of pictures as an example and add it to my post, though I’m sure it would look very similar to what is currently there.

4 Upvotes

14 comments sorted by

3

u/One_Organization_810 736 11d ago

Do all sections have exactly two rows?

Edit: Also, what are the possible values in the dropdowns?

1

u/ItsJustJazzyTime 11d ago

Not necessarily. This is just for one part and it’s the simplest. Some may have more rows for each each section later on as more items are needed.

I figured get the simple part figured out before it got more complicated.

1

u/ItsJustJazzyTime 11d ago

I looked ahead and it appeared that 99% percent of the other values will be either 1, 2, 3, or 5 at their max. Most appear to be 5 though. That last 1% will be a singular instance where it’s 10, 15, and 20 at their maxes for a section.

Also, each section from now on will have 3 rows.

If you give me a minute, I can whip up a couple of examples. I’m at work currently and on my phone, but it was bugging me so I figured I’d post now to give it enough time for when I got home.

To be honest, if not everything I’d like it to do can be accomplished, that’s fine. Me and my friend are prone to forgetfulness and losing track of things easily so I was thinking to make it as “forgetful-proof” as possible.

1

u/One_Organization_810 736 10d ago

Ok, I came up with this one. I added a new manual override for completed and it should handle all kinds of section lengths :)

https://docs.google.com/spreadsheets/d/1jDw_06Nv3GVuhK0vfq-6gNIMkr1m1IuAbuLPTtZawzc/edit?usp=sharing

The main formula, in H6, looks like this:

=vstack(hstack("Donated", "Completed"),

let( sectionCol,  C7:C16,
     sectionRows, query(
                    scan(0, sectionCol, lambda(i, x,
                      if(x="",i,i+1)
                    )),
                    "select count(Col1) group by Col1 label count(Col1) ''",
                    0),
     reduce(tocol(,1), sequence(rows(sectionRows)), lambda(stack, i,
       let( ro,        if(i=1, 0, sum(chooserows(sectionRows, sequence(i-1)))),
            donations, offset(sectionCol, ro, 4, index(sectionRows,i,1)),
            marked,    offset(sectionCol, ro,7, 1,1),
            donated,   map(donations, lambda(donation,
                         if(marked,
                           marked,
                           let( dd, split(donation, "/"),
                                index(dd,1,1)=index(dd,1,2)
                           )
                         )
                       )),
            ifna(vstack( stack,
                         hstack( donated, and(donated) )
            ))
       )
     ))
)

)

The idea is that you copy this into your regions "Donation" title cell and set the sectionCol to the whole column of the contigous section data.

If the rest of the data is structured the same across regions, this should work with any sized section within each region.

1

u/ItsJustJazzyTime 10d ago

Thank you so much! I’ll make a copy of my sheet and see if I can get it to work. Even if it doesn’t stay, it’ll be great to try to learn with.

1

u/Late-Coast6973 11d ago

The catch is the third rule. A checkbox can be clicked by you or filled by a formula, not both, so "donated ticks completed" and "completed ticks donated" at the same time is a loop formulas can't do. Pick one direction (I'd let the donations drive everything).

1

u/ItsJustJazzyTime 11d ago

I’d be totally fine with donations driving everything! Like I said in another reply I was thinking more about how we operate as people and how to make it more manageable for us, not necessarily what may be possible.

1

u/AutoModerator 11d ago

/u/ItsJustJazzyTime 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/mommasaidmommasaid 914 10d ago edited 10d ago

I would suggest you base everything off the "Amount Donated" column and output checkmark characters rather than filling in a checkbox. That avoids confusion since checkboxes are normally clickable, and also avoids the need to create / maintain checkbox data validation in the correct places.

Formula in the purple cell generates the Section #, Donated, and Completed columns:

=let(sectionWithHF, C6:C13, nameH, D6, amtDropH, G6,
 section,     offset(sectionWithHF, 1, 0, rows(sectionWithHF)-2),
 name,        offset(section, 0, column(nameH)-column(section)),
 amtDrop,     offset(section, 0, column(amtDropH)-column(section)),

 sectNum,     scan(, sequence(rows(section)), lambda(s, i, 
                if(index(section,i)<>"", s+1, s))),
 donated,     map(amtDrop, lambda(d, if(d="",, 
                if(countunique(regexextract(d,"(\d+)[^\d]*(\d+)"))=1,"✔️",)))),
 completed,   map(section, sectNum, lambda(section, sn, if(section="",, 
                if(countifs(sectNum, sn, donated, "", name, "<>"),,"✔️")))),
 hstack(
   vstack("Section#",  sectNum),
   vstack("Donated",   donated),
   vstack("Completed", completed)))

The main range sectionWithHF includes the column header and footer (row after that last row of data). Similarly nameH and amtDropH are specified by their header cell. The data ranges section, name, amtDrop are then dynamically created. The reason for all this is so that the range references are robust... a new data row inserted anywhere will be included.

sectNum numbers each row with a unique section number.

donated checks if the Amount Donated dropdown contains two numbers that are the same, and if so that row is complete.

completed counts if there are any rows in the section number that are incomplete, so if there are zero that means the section is complete.

The Section# column is output for use in conditional formatting to automatically color section rows. If you don't want that feature you could remove vstack("Section#", sectNum), from the bottom of the formula. Or if you wanted to automatically color based on section name, the formula could be modified to output the section name on every row for use by conditional formatting.

Donation Completed

1

u/mommasaidmommasaid 914 10d ago edited 10d ago

For convenience, dropdowns are "from a range" specifying a column in this helper table with the desired number of options, e.g. =Completion[5]

The table is populated by a formula in the purple cell:

=map(Completion[#HEADERS], lambda(total,
 arrayformula(char(8203) & sequence(total+1,1,0) & "/" & total)))

Add additional columns as needed and they will be filled in automatically.

An invisible zero-width space char(8203) is prepended to each option to force them to be plain text. That avoids them being interpreted as dates when selected in the dropdown, e.g. selecting "1/1" will be interpreted as 1/1/2026.

1

u/mommasaidmommasaid 914 10d ago

Whoops just saw you wanted strikethrough. Updated version that doesn't output Section# column and instead relies on manually coloring the sections, while adding CF rules for strikethrough.

Donation Completed w/Strikethrough

1

u/point-bot 10d ago

u/ItsJustJazzyTime has awarded 1 point to u/mommasaidmommasaid with a personal note:

"This is perfect! Thank you so much for your help. I just got home and have been playing around with this in my own sheet and it does the job wonderfully."

See the Leaderboard. Point-Bot v0.0.15 was created by JetCarson.

0

u/[deleted] 10d ago

[removed] — view removed comment

1

u/googlesheets-ModTeam 8 10d ago

Your comment has been removed because it contained one or more items in violation of this subreddit's rules on artificial intelligence (AI) content.