REVscene Automotive Forum

REVscene Automotive Forum (https://www.revscene.net/forums/)
-   Gaming, Computer Tech & Electronics (https://www.revscene.net/forums/gaming-computer-tech-electronics_32/)
-   -   Excel help please (https://www.revscene.net/forums/674506-excel-help-please.html)

westcoastgsr 09-28-2012 07:34 PM

Excel help please
 
Working on a work project and Im having problems with a formula. If i have 2 columns name and another with result I want to set up a formula to show the amount of times in a row someone gets.

Sample:
Name Result
bob Yes
bob no
bob no
bob no
bob yes
bob maybe
bob no
bob no
ted no
ted no
ted yes
ted no
ted no

So assumeing I have different names too but only 3 results I would want the fomula to show Bob had no 3 times in a row once and no 2 times in a row once. Ted got no 2 times in a row twice.

Fuck I hate when I forget how to do things in University. All help is appreciated of course!!!

Ferra 09-29-2012 07:49 AM

Do you need the output in a particular way? if not you can probably do something like this (assuming names are sorted /separated)
C3 =IF(B3="N", IF(C2>=1, IF(B2=B3, C2+1, 0), IF(B2=B3, 2, 0)), 0)

Col A = Name
Col B = Result
Col C = Formula
Values start row 2, formula starts at row 3

Quote:

So assumeing I have different names too but only 3 results I would want the fomula to show Bob had no 3 times in a row once and no 2 times in a row once. Ted got no 2 times in a row twice.
You can probably use a pivot table to sort and display the tables results...i.e. showing how many 2/3/4 in a rows total sum counts

westcoastgsr 09-29-2012 05:25 PM

Thanks the formula works. But the names are not sperated but they are sorted alphabetically. So the problem is the results blend together. For example:

Bob n
Bob n
Bob n
Ted n
Ted n

Then it say there was 4 in a row.

Ferra 10-01-2012 06:49 AM

Quote:

Originally Posted by westcoastgsr (Post 8042621)
Thanks the formula works. But the names are not sperated but they are sorted alphabetically. So the problem is the results blend together. For example:

Bob n
Bob n
Bob n
Ted n
Ted n

Then it say there was 4 in a row.

you can add another "if (A2=A3, x, 0) function infront of the formula
> C3 = IF(A2=A3, IF(B3="N", IF(C2>=1, IF(B2=B3, C2+1, 0), IF(B2=B3, 2, 0)), 0), 0)

Btw..just notice the formula I posted is "cumulative" (i.e. if you miss 4 in a row, it will show both 2, 3, and 4 in the results)
depending on how you want your result....you might need to add another function or another column to take out the cumulative results.


All times are GMT -8. The time now is 09:17 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
SEO by vBSEO ©2011, Crawlability, Inc.
Revscene.net cannot be held accountable for the actions of its members nor does the opinions of the members represent that of Revscene.net