Search code examples
excelmathcountformulaequation

Excel: Count sum of cells along a row until a value is found


Picture 50 rows that all have a number "4" in it. However in each row there are 26 columns (A-Z) and the 4 is placed on a different letter in each row. I need a count of finding the "4" in each row (i.e. if it's "E" that the "4" sits in, the count should be "5".

the 1 should be counted as a 5 because the 4 is 5 cells along

the 1 should be counted as a 5 because the 4 is 5 cells along


Solution

  • Without seeing your column headings, I think you can just use the MATCH function.

    =MATCH(4,A1:I1)
    

    MATCH

    Result

    Result

    You just need to adapt it to your range.