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?


[TABLE="class: outer_border, width: 500, align: left"]
<tbody>[TR]
[TD]Column D[/TD]
[/TR]
[TR]
[TD]e-Gift cards,Gift cards[/TD]
[/TR]
[TR]
[TD][TABLE="width: 520"]
<tbody>[TR]
[TD="width: 520"]Gift cards[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 520"]
<tbody>[TR]
[TD="width: 520"]Points Transfer[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 520"]
<tbody>[TR]
[TD="width: 520"]Travel rewards[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][TABLE="width: 520"]
<tbody>[TR]
[TD="width: 520"]Travel rewards,Gift cards[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
[TR]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
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,223,893
Messages
6,175,239
Members
452,621
Latest member
Laura_PinksBTHFT

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