How to select dynamic value using COUNTIF Forumula

yakhtar

New Member
Joined
Mar 18, 2014
Messages
26
I have a column with multiple values with some separated by a comma. I am using a COUNTIF function to get the count of values - for example, I have a worksheet "Data" from where I am pulling the data as is shown in this formula:
=COUNTIF(Data!D:D,"*Gift cards*")

I am putting the "*" before and after the value to make sure I am including the comma and putting the name of the value (in this case "Gift cards".

Is there a way to pull this data dynamically without having to put the value name? For example: COUNTIF(Data!D:D,"H5") and making sure I am also accounting for values separated by comma?


Column D
e-Gift cards,Gift cards
Gift cards

<tbody>
</tbody>
Points Transfer

<tbody>
</tbody>
Travel rewards

<tbody>
</tbody>
Travel rewards,Gift cards

<tbody>
</tbody>

<tbody>
</tbody>
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi kvsrinivasamurthy, thanks for your response. I am getting a "0" when I use the formula =COUNTIF(Data!D:D,"*"&"H5"&"*"). Any other suggestions?
 
Upvote 0

Forum statistics

Threads
1,213,510
Messages
6,114,044
Members
448,543
Latest member
MartinLarkin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top