Lightkeeper
New Member
- Joined
- Dec 25, 2018
- Messages
- 4
I have a fictive criminal register and would like to count number of points on the driver's license. I have a COUNTIFS that looks up the social security number from H3. D has the social security number and V has "1 point", "2 points" or "Suspension" (3 points yields suspension). Here I have COUNTIFS to sum the number of points - I multiply the 2 points with 2 because it shall counts "2 points" as 2. I hope you understand.
My code is as follows:
Now, I would like a check that resets the count on either of these conditions:
- If the points reaches 3 it should reset to 0. Let's say that Monday the person gets a point, and Wednesday he gets 2 points. This would result in 3 points and suspension. Hereby the count is reset and the person would have one point again on next violation.
- If there's a Suspension the count also resets. If the person gets a point and then a Suspension the next day, the count resets again and he starts with a clean slate.
All conditions should of course be in chronological order.
It must be a formula for one cell. Copy-down is not an option. So basically it changes the cell accordingly. 0, 1, or 2 points on drivers license.
The code must be for Google Sheets because the database is used by several users.
I hope you can help with this. Thank you so much
My code is as follows:
Code:
=[FONT=Verdana]IF(COUNTIFS(D:D;H3;V:V;"1 point")+COUNTIFS(D:D;H3;V:V;"2 points")*2>2;"0";COUNTIFS(D:D;H3;V:V;"1 point")+COUNTIFS(D:D;H3;V:V;"2 points")*2[/FONT]
Now, I would like a check that resets the count on either of these conditions:
- If the points reaches 3 it should reset to 0. Let's say that Monday the person gets a point, and Wednesday he gets 2 points. This would result in 3 points and suspension. Hereby the count is reset and the person would have one point again on next violation.
- If there's a Suspension the count also resets. If the person gets a point and then a Suspension the next day, the count resets again and he starts with a clean slate.
All conditions should of course be in chronological order.
It must be a formula for one cell. Copy-down is not an option. So basically it changes the cell accordingly. 0, 1, or 2 points on drivers license.
The code must be for Google Sheets because the database is used by several users.
I hope you can help with this. Thank you so much