Search code examples
excelworksheet-function

Excel, get string value on cell


How do I get the cell from a string? I'm counting the number of times a specific string occurs on another worksheet. I have this formula:

=COUNTIF('Season 1'!$D$2:$F$1768,"*Player 1*")

Instead of having to do this manually with all other players, how do I reference the cell containing the string "Player 1" without having to manually type the string into the formula?


Solution

  • If your list of players starts in cell A1 then try

    =COUNTIF('Season 1'!$D$2:$F$1768,"*" & A1 & "*")
    

    then copy down