Count IF formula?

bflan0524

Board Regular
Joined
Oct 7, 2016
Messages
192
Office Version
  1. 2010
hello
I don't know if this would be a count if formula, or something else, any ideas
I have 3 columns of data that have unique ID Codes
for example
Column A Row 1: ABC
Column B Row 1: BCD
Column C Row 1: ABC

I want to show the % of time that one officer code was the same, so for this example ABC was the officer code 67% of the time
thank you
 
Last edited:

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
You could put the following formula into cell D1, and format the cell type to be Percentage:
Code:
=COUNTIF($A1:$C1,"ABC")/3

Do you wish to check the percentage of "ABC" for every row?

Caleeco
 
Last edited:
Upvote 0
thank you, but each row could be totally different set of unique codes. so for example

Column A row 1: ABC Column B Row 1: BCD Column C Row 1: ABC
Column A Row 2: CDE Column B Row 2: CDE Column C Row 2: BCF
 
Upvote 0
Hello,

OK, maybe i misunderstood. Do you want to check which CODE appears the most number of times on each row?
What happens when there is a draw? eg ABC, BCD, CDE?

Caleeco
 
Upvote 0
correct, sorry I was probably unclear with my description
knowing the data set that shouldn't happen
 
Upvote 0
Ok no problem. And what do you want to return? Just the % in column D? or the most frequent code in column D, with % of that code in Column E?

Thanks
Caleeco
 
Upvote 0
I think the latter would be best, the most frequent code in D and the % In column E
actually as I did look at the data set though I did see an example of a draw

could I add another column too # of times changed, so in the example of where it was a draw eg ABC, BCD, CDE it would be show 3
if it was ABC, ABC, ABC it would be 0
etc

does that make sense? thank you for your patience
 
Upvote 0
also in the example above for how many times it changed, if it went from blank to say ABC that would obviously count as a change

ty
 
Upvote 0
Hello, try this for the first part of your question:

In Column D1 use this equation to return the most frequent code:
<countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))[ code]
<countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))
<countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))
EDIT: Formula not posting correctly
149nkp4.png


<countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))[ code]
In column E1 use this equation to return the %:
Code:
=COUNTIF($A1:$C1,D1)/3

Copy rows down as needed. Does this return the expected results?

Caleeco</countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))[></countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))
</countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))
</countif($a1:$c1,$b1),if(countif($a1:$c1,$a1)<countif($a1:$c1,$c1),3,2),1))[>
 
Last edited:
Upvote 0
for the first one it says I am missing a (....I put one in the end but it still didn't work
 
Upvote 0

Forum statistics

Threads
1,214,807
Messages
6,121,679
Members
449,047
Latest member
notmrdurden

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