Using Countif for Variable Search Criterea in Excel

For the attached Excel sheet I would like the countif formula in P1 to be copied down column P, however I would like the formula to use whatever value is in Column O (same line) as a variable and return the value in Column Q (same line). The search area will always remain the same - A2:G5014.
bpfsrAsked:
Who is Participating?
 
Saqib Husain, SyedEngineerCommented:
enter this formula in P2 and copy down

=COUNTIF($A$2:$G$5014,"*"&O2&"*")
0
 
Saqib Husain, SyedEngineerCommented:
Whilst you are sending the file try changing A2:G5014 to $A$2:$G$5014
0
 
bpfsrAuthor Commented:
yup, forgot the file... SP2.xlsm
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.