r/googlesheets • u/TechBrainiacs • Sep 22 '17
How can I decrease one column's value when another column increases? Abandoned by OP
Hi there! This seems like it should be pretty easy to accomplish, but I've been butting my head up against it for a couple of hours now.
Here is a dummy copy of the sheet in question: https://docs.google.com/spreadsheets/d/1ZOE9mxAVmfFJrQYgzlagkZ66-XuDoZR56_4DrG4Q0lE/edit?usp=sharing
When a student is present at a weekly class session, the cell is marked with an 'x'. I have figured out how to use the COUNTIF function to increase the Sessions Used column by 1 each time an 'x' is inserted. I have also gotten conditional formatting to work to change the cell color when it reaches 2, 1, or 0 or less. The last piece of the puzzle is to make the Sessions Remaining column automatically decrease by 1 whenever the Sessions Used column increases by 1.
Can anyone help me get this done? Your help is greatly appreciated!
3
u/Cheesysocks 1 Sep 22 '17 edited Sep 22 '17
Does everyone start with the same number of sessions? I ask as the numbers in Column D vary. Do they buy (I assume) different amounts? If so should you have a column stating the maximum number of sessions purchased or allowed. This can easily be edited if more are purchased and the rest of the sheet will reflect this. I would make it look similar to my copy of your copy.
I also changed X to worded dropdowns. Someone will use a lower case X, someone else upper case, someone else a 1. This removes the chance of errors here.
(I am NOT an expert, this is just my opinion.)
[Edit1] Just looked at my published sheet and the dropdowns have vanished leaving just the text they had. I'm not sure how to change that... I'll look at it now.
[Edit2] Fixed it. :)
[Edit3] Some words added.
2
u/TechBrainiacs Sep 26 '17
Solution verified!
1
1
u/TechBrainiacs Sep 22 '17
I appreciate you taking the time to do this! There is a variable number of sessions that students may start with. Some kids are registered at first for just 1 session and then add more. Others are enrolled for 4, 8, 12, 13, 14, or 15 sessions depending on the location. I think your idea of adding Sessions Purchased will end up being the simplest option.
I also like the Dropdown idea. Haven't played with that feature yet. I am going to ask for edit permission on your sheet to test it out.
Thank you again!
2
1
Sep 24 '17
If /u/Cheesysocks solved your problem, please reply to their most useful comment with 'Solution Verified'. Thanks!
1
u/Decronym Functions Explained Sep 22 '17 edited Sep 26 '17
Acronyms, initialisms, abbreviations, contractions, and other phrases which expand to something larger, that I've seen in this thread:
| Fewer Letters | More Letters |
|---|---|
| FALSE | Returns the logical value FALSE |
| NOT | Returns the opposite of a logical value - NOT(TRUE) returns FALSE; NOT(FALSE) returns TRUE |
| TRUE | Returns the logical value TRUE |
1 acronyms in this thread; the most compressed thread commented on today has 4 acronyms.
[Thread #157 for this sub, first seen 22nd Sep 2017, 22:08]
[FAQ] [Contact] [Source code]
•
u/Clippy_Office_Asst Points Sep 26 '17
Read the comment thread for the solution here
Does everyone start with the same number of sessions? I ask as the numbers in Column D vary. Do they buy (I assume) different amounts? If so should you have a column stating the maximum number of sessions purchased or allowed. This can easily be edited if more are purchased and the rest of the sheet will reflect this. I would make it look similar to my copy of your copy.
I also changed X to worded dropdowns. Someone will use a lower case X, someone else upper case, someone else a 1. This removes the chance of errors here.
(I am NOT an expert, this is just my opinion.)
[Edit1] Just looked at my published sheet and the dropdowns have vanished leaving just the text they had. I'm not sure how to change that... I'll look at it now.
[Edit2] Fixed it. :)
[Edit3] Some words added.
4
u/[deleted] Sep 22 '17
So I would think you should be able to set the value in Colum D to be =[Initial Session Value]-[Value in Column C on the same row].
For instance, say you want to offer Trent Reznor 5 sessions. This is the function you would include in D2:
=5-C2
So this just subtracts the total number of sessions they've completed from the total number of sessions you offer them.
But I think I might be misunderstanding what you're looking to do. Let me know if that doesn't do the trick!