Counting a Distinct Absent Occurance

Stephen_IV

Well-known Member
Joined
Mar 17, 2003
Messages
1,180
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Good afternoon

I have been using this formula to count absence occurance but I am trying to add a variable to it where I just want to count all of the "PI" occurances. Can someone please help. Thanks in advance Stephen!

=SUMPRODUCT(--($A2:$L2<>$B2:$M2),--($B2:$M2<>""))+($A2<>"")

Book4
ABCDEFGHIJKLMNO
18/258/268/278/308/319/19/29/39/79/89/109/139/14Looking for
2PIPIPIPD32
3PI11
400
5PDVFMLA20
600
7FMLAFMLAFMLAPIFMLA41
Sheet1
 

Excel Facts

Convert text numbers to real numbers
Select a column containing text numbers. Press Alt+D E F to quickly convert text to numbers. Faster than "Convert to Number"
Using your posted sample...Try this ARRAY FORMULA, completed by pressing CTRL+SHIFT+ENTER (instead of just ENTER):
N2: =COUNT(1/FREQUENCY(IF((A2:M2="PI"),COLUMN(A2:M2)),IF((A2:M2<>"PI"),COLUMN(A2:M2))))

Copy N2 and paste into N3:N7

Using the sample data, these are the formula results:
N2: 2
N3: 1
N4: 0
N5: 0
N6: 0
N7: 1

Is that something you can work with?
 
Upvote 0
Hi,

Try:

Code:
=SUM(IF(FREQUENCY(IF(A2:M2="PI",COLUMN(A2:M2)),IF(A2:M2<>"PI",COLUMN(A2:M2))),1))
In N2, committed with CTRL+SHIFT+ENTER and then copied down.

Matty
 
Upvote 0
After some experimentation...

Here's a regular formula (completed by just pressing ENTER) that returns the same values
N2: =COUNT(INDEX(1/(B2:M2="PI")/(A2:L2<>"PI")*COLUMN(A2:L2),0))

Copy that formula down through N7

EDITED TO INCLUDE THIS COMMENT:
Flaw: That formula does not recognize a "PI" value in Col_A.
That could possibly be mitigated by having the data start in Col_B or
by inserting a column before the data and having the formula reference that preceding column.
Example:
O2: =COUNT(INDEX(1/(B2:N2="pi")/(A2:M2<>"PI")*COLUMN(B2:M2),0))
 
Last edited:
Upvote 0
Actually, referenced range would have to extend before and after the actual data range by one column on either side:
P2: =COUNT(INDEX(1/(B2:O2="PI")/(A2:N2<>"PI")*COLUMN(B2:O2),0))
 
Upvote 0
Beautiful Thanks Matty and Ron,

Ron great formula like the INDEX(1/ approach! Thank you both again!
 
Upvote 0

Forum statistics

Threads
1,224,613
Messages
6,179,896
Members
452,948
Latest member
Dupuhini

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