Formula: count co occurrence of elements of 2 columns in one row.

Vlad_2019

New Member
Joined
Apr 1, 2019
Messages
1
Dear community,

I need a formula that would count how many times an element of one column co-occurs with another element in each row. The input is represented in Figure 1. The result (see Figure 2) could look as follows. The formula counts how many times H* co-occurs with n and p. In this case, it would be 1 for n and 2 for p. The same calculation would be performed with L+H*. I think that the countifformula can be applied here however, I do not know how to create a link between the two elements, n and p.

=COUNTIF(F2:F343; "H*"//how to link it with p/n?).

I am glad about every feedback and would be very grateful if you could help me. I work with a rather big data bank and. It is barely possible to count the elements manually and without making a mistake.


Figure 1:
[TABLE="width: 500"]
<tbody>[TR]
[TD]pre-nuclear/ nuclear[/TD]
[TD]Symbol[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]H*[/TD]
[/TR]
[TR]
[TD]n[/TD]
[TD]L+H*[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]H*[/TD]
[/TR]
[TR]
[TD]p[/TD]
[TD]L+H*[/TD]
[/TR]
[TR]
[TD]n[/TD]
[TD]H*[/TD]
[/TR]
</tbody>[/TABLE]

Figure 2:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Symbol[/TD]
[TD]n[/TD]
[TD]p[/TD]
[/TR]
[TR]
[TD]H*[/TD]
[TD]1[/TD]
[TD]2[/TD]
[/TR]
[TR]
[TD]L+H*[/TD]
[TD]1[/TD]
[TD]1[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce
Hi & welcome to MrExcel.
How about


Excel 2013/2016
ABCDEF
1pre-nuclear/ nuclearSymbolSymbolnp
2pH*H*12
3nL+H*L+H*11
4pH*
5pL+H*
6nH*
Data
Cell Formulas
RangeFormula
E2=COUNTIFS($B$2:$B$6,$D2,$A$2:$A$6,E$1)
 
Upvote 0

Forum statistics

Threads
1,224,820
Messages
6,181,154
Members
453,021
Latest member
Justyna P

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