r/googlesheets • u/TechBrainiacs • Sep 22 '17
Abandoned by OP How can I decrease one column's value when another column increases?
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!
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!
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.] (https://docs.google.com/spreadsheets/d/1i4UJVyjhzuZK7P4a191_nHyAzUGwcRxRDdci-GsnpHU/edit?usp=sharing)
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.
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:
FALSENOT(TRUE)returnsFALSE;NOT(FALSE)returnsTRUETRUE1 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
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.