Formula for incidence frequency based on value in another column

mrpablissimo

New Member
Joined
Jun 22, 2022
Messages
3
Office Version
  1. 2016
Platform
  1. Windows
Hello,

I do bird surveys and I gather a lot of data. I am trying to calculate the number of point counts on which a species is present.

My data looks like this:
Screenshot 2022-06-22 085523.png


I am trying to find the number of times a sample station (column A), has at least one instance of a species (column E). Or put otherwise, for a value in column E, how many distinct values are there in column A?

I think I am looking at a SumIf formula based on distinct values, but I'm new to anything beyond very basic excel formulas. Any help is appreciated.
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
Welcome to the Forum!

Like this perhaps:

ABCDE
1StationSpecies
21B-CONI
31B-DUFL
41B-MOBL
51B-VESP
61B-WWPE
71B-MOBL
81B-WETA
91B-WWPE
101B-WWPE
111B-VESP
122B-MOBL
132B-WETA
142B-CONI
152B-DUFL
163B-CONI
17
18SpeciesStations
19B-CONI3
Sheet1
Cell Formulas
RangeFormula
B19B19=SUM(--(FREQUENCY(IF(E2:E16=A19,MATCH(A2:A16,A2:A16,)),ROW(A2:A16)-ROW(A2)+1)>0))
 
Upvote 0
Solution
Hi Stephen,

Thanks for your help. When I tried this into my document, adjusting all the ranges appropriately, I always get the value "1" or an #value error message. I thought it may be an issue on my end, so I copied exactly the format on your screenshot but to the same result. But yours clearly is working on that end. Could it be an excel version issue with the formula? Something else?
 
Upvote 0
Sorry, yes it's a version issue. I'm using Excel 365.

You'll need to array-enter this formula, i.e. CTRL-SHIFT-ENTER, rather than just ENTER.
 
Upvote 0
Alternative solution, including unique species list extract:
Book1
ABCDE
1StationSpecies
21B-CONI
31B-DUFL
41B-MOBL
51B-VESP
61B-WWPE
71B-MOBL
81B-WETA
91B-WWPE
101B-WWPE
111B-VESP
122B-MOBL
132B-WETA
142B-CONI
152B-DUFL
163B-CONI
17
18SpeciesStations
19B-CONI3
20B-DUFL2
21B-MOBL2
22B-VESP1
23B-WWPE1
24B-WETA2
25  
26  
27  
28  
Sheet1
Cell Formulas
RangeFormula
A19:A28A19=IFERROR(INDEX($E$2:$E$16,MATCH(0,INDEX(COUNTIF($A$18:A18,$E$2:$E$16),),0)),"")
B19:B28B19=IF(A19="","",SUM(IF($E$2:$E$16=A19,1/COUNTIFS($E$2:$E$16,A19,$A$2:$A$16,$A$2:$A$16))))
Press CTRL+SHIFT+ENTER to enter array formulas.
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,930
Members
452,367
Latest member
TePunaBloke

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