Count consecutive instances of a particular value

is there a way to have numbers look at a colum and give me the number of the highest consecutive anserws. Here is the example I am dealing with.
I would like to have a total at the bottom of each column that will calculate the most consecutive right answers in each column. That way I can award a prize to the person that got the most correct in a row.
Stacy

Hi Stacey,
That's an interesting challenge. Here's my approach:
There are two Header Rows, even though I made the formatting change to make the second header row look like a body row for consistency with the rest of the data. The reason I did that is so that you can expand the table and have the new rows automatically fill with the formulas of the body rows. Adding rows when all body rows are the same causes the autofill behavior. I needed the first data row to have a different equation, so I used a header for the first row of data.
So, here are the equations:
B2: =IF(B="Right", 1, 0)
B3 to the last body row: =IF(B="Right", C2+1, 0)
Column B's first Footer row:
=COUNTIF(B, "Right")+COUNTIF(B2, "Right")
Column B's second Footer row:
=COUNTIF(B, "Wrong")+COUNTIF(B2, "Wrong")
Column B's third Footer row:
=MAX(C, C2)
That's it.
Regards,
Jerry

Similar Messages

  • Counting rows with a particular value

    Hello. I recently posted this thread Count java problem for how to count an attribute.
    Now I need that count to be limited to a certain value inside the attribute.
    let me clarify. I have a table Casinos, which is connected to a table SlotsInCasinos, which is further connected to SlotMachines in a many to many with SlotsInCasinos being the intersection.
    The previous post that I mentioned (thanks Timo by the way) told me how to count all the slots in a particular casino.
    Now I would like to know how I could count all the slots of a particular value (for example Poker slot Machines, regular Slot machines, etc) instead of the total count in a particular object.
    So on the page I would have lets say 2 output texts, one showing the number of Poker Slot Machines in that particular casino and the other showing the number of regular Slot machines in that particular casino (a third could show the number of some third kind of slot machines).
    Thank you for your time

    Hello everyone here is an update
    I created a view object called Test, based on the entity object SlotMachinesInCasino. I then created a view link TestLink and created a master detail relationship (the same one I already had for the View Object SlotMachinesCasinosVO.
    The difference is in the query for test I put the following
    SELECT
        VezaTehOpTipAp.OBJEKAT_ID,
        VezaTehOpTipAp.TIP_APARATA_ID,
        VezaTehOpTipAp.VEZA_TEH_OP_TIP_AP_ID,
        TIPOVI_APARATA.NAZIV_APARATA NAZIV_APARATA
    FROM
        VEZA_TEH_OP_TIP_AP VezaTehOpTipAp,
        TIPOVI_APARATA
    WHERE
        TIPOVI_APARATA.NAZIV_APARATA = 'Evona'My thinking was that if I do this the estimated row count function for this will just give me the number of Evona Game machines. I tried it out in an SQL Worksheet and it gives back only the Evona machines.
    Unfortunately when I create the TestIterator and then drop output text whose EL is the estimated row count for the test iterator it does not work as intended. It counts all the Slot Machines in the Object no matter the Name.
    So it gives a number equal to all the slot machines instead of to the number of slot machines with name 'Evona'.
    What did I do wrong?

  • In PerfDataSource could not resolve counter instance OpsMgr DW Synchronization Module,Total Error Count,All Instances.

    Hello,
    Event viewer Shows warning 10103 in one of SCOM Server 2012 R2.
    In PerfDataSource could not find counter <counter name> in Snapshot. Unable to submit Performance value. Module will not be unloaded.
    One or more workflows were affected by this.  
    Workflow name: <workflow name>
    Instance name: <instance name> Instance ID: {<ID>}
    Management group: <group>.
    Counter: "OpsMgr DW Synchronization Module, Total Error Count, All Instances" 
    How can solve its?
    Thanks

    Hi,
    Can you try to open perfmon and add above counters to see if they are there?
    In addition, please also try to manually create the collection rule of OpsMgr DW Synchronization Module object and check the performance counters.
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Hashtable- how to retrieve key for a particular value?

    I fetched few values from the database and stored all them using hashtable. Then i check for the value entered by the user in a textbox using contains() method of hashtable. Now i want to fetch the key associated to this particular value so that i can pass it to my rest of the program?
    Pls help me....

    The obvious question is what are you using as your key when you store the value into your hashtable?? The idea behind the key/value system is that you use the key to get the value you want, not the other way around. In your current situation, the contains() method might return true, but that could you mean you have 1, or 1000 instances of that value in your hashtable. Which key do you want? You could, I suppose, parse through the output of Hashtable.toString()... but that still wouldn't resolve the possibility of duplicate values in the hash.
    Another possible solution to your problem, depending on how your application works, is to wait until you get that user input before running your database query. Simply append the added info onto your SQL SELECT statement to accurate retrieve only those entries from the database that you will need.

  • Return all instances of a string value

    I know that similar questions have been asked before but I am having a tough time getting things to work.
    I would like to search for all instances of a string value (shown red) and return the corresponding values in the adjacent cells (shown green) so that each room number is represented.  For example, I want the search for "Adequately" to return rooms 236 and 237 (and 237 just once even though it is listed twice).  Is this possible?
    Any help is appreciated.
    Clay

    Here's an example, similar in some ways to Yvan's, but taken a bit further.
    Data table (left) contains only the original data. I've shortened the ratings to allow an easier fit on this page.
    Summary table does the work in two stages.
    Pulls the room numbers for rooms matching each rating. (yellow portion of table. If desired, these rows may be hidden.
    Builds a list of these for each condition. (Footer row)
    Formulas (all on Summary)
    Row 1 is a header row, and contains the Rating labels, which must match those used on the Data table.
    B2:   =IF(AND(Data :: $E2=B$1,COUNTIFS(Data :: $E$2:$E2,B$1,Data :: $C$2:$C2,Data :: $C2,Data::$B$2:$B2,Data :: $B2)=1)," "&Data :: $B2&" "&Data :: $C2&" ","")
    Fill right to column F. Fill down to row 16 (as many rows as there are data rows on Data)
    Note the " " at the beginning and end of the 'if true' part: " "&Data :: $B2&" "&Data :: $C2&" "
    There is a single space between each pair of quotation marks. These are necessary to the second formula below.
    Row 17 is a Footer row.
    B17:  
    =IF(COUNTA(B)-COUNTBLANK(B)=0,"",TRIM(SUBSTITUTE(CONCATENATE(B2,B3,B4,B5,B6,B7,B 8,B9,B10,B11,B12,B13,B14,B15,B16),"  ",",
    There is a return character in the formula immediately before the last quotation mark. Press option-return to enter a return into a formula.
    SUBSTITUTE finds the two spaces added between items in the list and replaces them with a comma followed by the return noted above.
    TRIM is used to remove the single space before the first item in the list and the single space after the last.
    Regards,
    Barry

  • Count of schema based on the value in a column

    I have to write a query to count the number of schema that have the value in a column as '1' in a table For ex
    I have a table called Vendor in all the schemas(schema1 through 50) I have to look for the value in a column(Benefits) if it 1 or 0 . I need to do the count of the number of schema who have the Benefits turned ON (value '1')
    suppose the value in benefits(col) in Vendor (tbl) for schema1 is 0 than donot count that schema
    and if the value in benefits(col) in Vendor (tbl) for schema2 is 1 than count
    do i connect as a system manager? Do I need a Pl/sql table to put the count in it
    anybody please help.
    TX
    KK

    As I understand from 325537 description, the table VENDOR contains only one row and column BENEFITS_TRACKING is either 0 or 1
    In this case the total can be calculated by simply summing the values of all BENEFITS_TRACKING
    In case VENDOR has more than one row you need some grouping function like SUM or COUNT
    I don't unterstand why you loop through dba_users.
    Im quite sure that you won't find a VENDORS table in the SYSTEM schema. The 'execute immediate' will fail with a table not found exception.
    Another problem in your code is, you will get no_data_found exception when benefits_tracking=0 because of your where condition
    (remove the where-condition or use a grouping function as explained above)
    declare
      v_count      pls_integer := 0;
      v_curr_count pls_integer := 0;
    begin
      for rec in (select owner from all_tables where owner like 'SCHEMA%' and table_name='VENDORS') loop
          execute immediate 'select SUM(BENEFITS_TRACKING) from '||rec.owner||'.VENDORS' into v_curr_count;
    --      execute immediate 'select COUNT(BENEFITS_TRACKING) from '||rec.owner||'.VENDORS where BENEFITS_TRACKING=1' into v_curr_count;
    --      execute immediate 'select BENEFITS_TRACKING from '||rec.owner||'.VENDORS' into v_curr_count;
          v_count := v_count + v_curr_count;
      end loop;
      dbms_output.put_line(v_count);
    end;

  • How to use parsing technique to access a particular value from a webpage

    hi,
    i'm in need of a coding to access a particular value from a webpage only by using its link. one of my friend said the we can do this by parsing technique. but i doesn't have knowledge about it. can any one help me?

    ksnagendran26 wrote:
    hi,
    i'm in need of a coding to access a particular value from a webpage only by using its link. one of my friend said the we can do this by parsing technique. but i doesn't have knowledge about it. can any one help me?I'm sorry could you explain in detail what do you mean by +"access a particular value from a webpage only by using its link"+?

  • How to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 using ftp

    how to edit xml file particular value. and how to send xml file over ip address 192.168.2.10 device using ftp through Ethernet

    Hello
    For using FTP function in LabVIEW, I recommend you to check this document: FTP Basics
    Also, take a look at FTP Browser.vi, which is available at the Example Finder.
    To edit a XML file, try to use VIs in XML palette. Maybe Write to XML.vi helps you.
    Post your current VI if possible.
    Regards
    Mondoni

  • Consult a Lookup in a particular value from a reconciliation

    Hello everybody ...
    I need to find a method (tcLookupOperationsntf) that searches a Lookup a certain value (string). For example, I have several records in a Lookup as follows OU=pp_99123,OU=PE,DC=domain,DC=net , I contain only the number 99123 which is a unique identifier. I need that number by 99,123, I return the full amount coming from the Lookup OU=pp_99123,OU=PE,DC=domain,DC=net. It would be a research method, but I can not find. Does anyone know answer me?
    Thank you in advance

    Hi Sam,
    You cannot do this directly as exclusion, but you can include all other values, even as ranges and thus exclude the particular value, else you can also try to do this by writing a routine.
    Hope this helps...

  • Query not executing for one particular value

    Hi
    I have query on multi provider. and this multi provider is combination of Info objects only but not any ODS or cubes. I have one key figure in this multi provider.while executing the query i need to give input for variabl which has 7 different values. Query is executing fine for 6 values but not for one particular value.
    query executed in listcube transaction and it is executed fine here for the same selection. then what might be the reason?
    Please advise as soon as possible.
    Thanks

    Hi Kiran,
    are you maintaining any filters in the query? or is there any logic in the exit for this variable.
    regards.

  • Stop a dimensional drill for a particular value of a column in obiee 11g

    Hi,
    I have dimensional drill been setup for Supervisor Hierarchy Table.I need to stop the dimensional drill for a particular value of the column in obiee 11g.
    Example: I have two columns
    1.Supervisor Level 1 Name
    2.Supervisor Level 2 Name
    Supervisor Level 1 Name Columns have these values.(Ram,Higher,Sam)
    Supervisor Level 2 Name Columns have these values.(Ravi,Higher,Raghul).
    If we pull Supervisor Level 1 Name Column in report which has a dimensional drill(It will navigate to Supervisor Level 2 Name).It will show
    1.Ram
    2.Higher
    3.Sam
    I should not drill on Higher value but the rest of the values(Sam and Ram will drill to Supervisor Level 2 Name) should be drillable.The same should happen for Supervisor Level 2 Name.
    Please Suggest.
    Thanks,
    Azim

    Azim,
    Don't think you can actually get this working

  • Retriving data from database on selecting particular value in the combo box

    Hi,
    On selecting the particular value from the combo box, the corresponding value of the other segement fields should be retrived from databse and displayed in the text box

    Babel,
    If you don't have a query bdoc and the business query that joins both 2 tables already, then please crate one.
    After that, write this code on the change of the combobox.
    You would have to change the names below for the Query, properties, anchor, parameters, controls.
    ===================================
    Private Sub ctrlBankNameCombo_onValueChanged2(ByRef boundAttributeChanged As Boolean)
    On Error Resume Next
    Dim objBankQuery As BusinessQuery
    Dim ObjBankCol As BusinessCollection
    Dim strID As String
    If Not boundAttributeChanged Then Exit Sub
    strID = ""
    strID = myanchor.bo.getAttribute("BankNameComboProperty") ' Bank ID
    If strID <> "" Then
        Set objBankQuery = gServices.factory.newBusinessQuery("MyNewQuery")
        objBankQuery.Mandt = "000"
        objBankQuery.BANKID = strID
        Set ObjBankCol = objBankQuery.query 
           If Not ObjBankCol Is Nothing Then  
               ctrlBankAddress.Value = ObjBankCol.getAttribute(1, "BankAddress")
               ctrlBankPhone.Value = ObjBankCol.getAttribute(1, "BankPhone")
           End If
    End If
    ===================================
    Regards,
    Vadim.

  • Query  for  Closing Stock goes beyond a particular value.

    Hi,
    The query for the following requirement:
    The Closing Stock goes beyond a particular value. The Closing Value of items crosses the pre-defined value.

    Hi,
    Yes it is related to the user selected date and stock level. Not answered Closing the thread.
    Edited by: Neela M B on Aug 28, 2010 3:08 PM

  • Count consecutive days in array

    Hi,
    I'm looking for an algorithm to count consecutive days in array, but i don't find one.
    for example, if i have this array.
    2009/07/01
    2009/07/02
    2009/07/03
    2009/07/06
    2009/07/08
    2009/07/09
    2009/07/10
    2009/07/11
    The result be
    3
    1
    4
    Anyone have one?
    Thanks for all.

    jverd wrote:
    kajbj wrote:
    It's a fairly specialist algorithm so you are unlikely to find someone to post a solution. By just keeping a reference to the previous date, it is easy to iterate though the list counting consecutive dates.I think the trick to making this algorithm sucessful is to make sure that when you change months your algorithm doesn't set consec_days to 0 Why not?Presumably he's talking about this case:
    7/31
    8/1
    and not this case
    7/1
    8/1
    So he really should have said, "...when you increment month by one, or from 12 to 1, and the day went from the last day of the old month to 1, don't set consec_days to 0"Ok. I would use the Calendar class and SimpleDateFormat. The tricky part would otherwise be to keep track of days per month, and leap year.

  • Identifying articles having particular value in characteristic.

    Hi,
    This query is related to SAP IS Retail, don't know if it is also applicable to SAP R/3.
    I want to filter a list of articles having a particular value in the characteristic assigned to it.
    From where can i find the linkage. (Tables)
    Thank you,
    regards,
    Abhishek

    Hi,
    Check tables CABN, CAWN, KSML and KSSK.
    I hope this helps you
    Regards,
    Eduardo

Maybe you are looking for