Go to Post You know you've been involved with robotics too long when you see a remote-controlled traffic barrel coming up behind people and honking - and it doens't faze you. - GaryVoshol [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 06-08-2014, 11:05
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,791
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: How to CALCULATE assist points

Perhaps a better way of doing the calculation:

Quote:
=VLOOKUP(MIN(IF(COUNTA(C4:C6)>0,1,0)+IF(COUNTA(D4: D6)>0,1,0)+IF(COUNTA(E4:E6)>0,1,0), IF(COUNTA(C4:E4)>0,1,0)+IF(COUNTA(C5:E5)>0,1,0)+IF (COUNTA(C6:E6)>0,1,0)),G3:H6,2)
In this, I included the counta functions, although you could certainly utilize the ones to the side and bottom of the table you mentioned, which makes this equation even easier:

Quote:
=VLOOKUP(MIN(COUNTIF(C7:E7, ">0"), COUNTIF(F4:F6, ">0")),G3:H6,2)
Basically, we want to know how many rows and how many columns have something in them. From there, we could look at each possible combination exhaustively... but it's easier to look at the minimum of the two, as that will be the number of credited assists. Then I just created another table G3:H6 that has 0-4 in the first column and the corresponding scores in the second (0,0,10,30). Doing a vlookup on that second table lets me find the score that matches the number of assists performed and return it.

Note: Why doesn't excel have a function like Oracle's DECODE function in SQL? I so wanted to use that for this solution!

Edit: I just realized there's an edge case this doesn't handle correctly - two robots both poses in zone 1, then a third possesses in zones 2 and 3. Back to the drawing board!
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA

Last edited by Jon Stratis : 06-08-2014 at 11:14.
  #2   Spotlight this post!  
Unread 06-08-2014, 11:52
Jon Stratis's Avatar
Jon Stratis Jon Stratis is offline
Electrical/Programming Mentor
FRC #2177 (The Robettes)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Minnesota
Posts: 3,791
Jon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond reputeJon Stratis has a reputation beyond repute
Re: How to CALCULATE assist points

Ok, second try now that I had a few more free minutes...

Quote:
=VLOOKUP(MAX(COUNTA(C4,D5,E6), COUNTA(C4,E5,D6), COUNTA(D4,E5,C6), COUNTA(D4,C5,E6), COUNTA(E4,C5,D6), COUNTA(E4,D5,C6)),G3:H6,2)
Again, using the vlookup function to transition from number of assists to points. Here though, I'm simply doing a counta on each possible combination for 3 assists. By default, that also includes all possible combinations of 2 and 1 assists. By doing a max, we find the maximum possible assists that were counted.
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
  #3   Spotlight this post!  
Unread 06-08-2014, 11:57
AdamHeard's Avatar
AdamHeard AdamHeard is offline
Lead Mentor
FRC #0973 (Greybots)
Team Role: Mentor
 
Join Date: Oct 2004
Rookie Year: 2004
Location: Atascadero
Posts: 5,508
AdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond reputeAdamHeard has a reputation beyond repute
Send a message via AIM to AdamHeard
Re: How to CALCULATE assist points

Quote:
Originally Posted by Jon Stratis View Post
Ok, second try now that I had a few more free minutes...



Again, using the vlookup function to transition from number of assists to points. Here though, I'm simply doing a counta on each possible combination for 3 assists. By default, that also includes all possible combinations of 2 and 1 assists. By doing a max, we find the maximum possible assists that were counted.
Tangentially related. Index(match()) is much more efficient than vlookup, and a more robust way to link in case people insert collumns, etc... I find it more intuitive to setup as well.

The performance is far better. Not a huge issue for most excels, but a huge performance difference in google spreadsheets.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:52.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi