CountIF When Looking at Other Data

Amosbroker

New Member
Joined
Mar 26, 2018
Messages
32
I am looking to count values if there is data present in other columns. I am creating a cohort trend and only want to count records for which both years have a value. See below, I do not want to count previous or current year category due to current value being unknown for red record. How do incorporate a CountIf that only counts records that have either good, borderline, or too high in each category in each year?


Member IDPrevious ValueCategory Current ValueCategory Risk Movement
IDXX115Good115GoodNo Movement
IDxx178Too High178Too HighNo Movement
ID123143Borderline143BorderlineNo Movement
ID1234108Good101GoodNo Movement
ID12345100GoodUnknown

<colgroup><col><col><col><col><col><col></colgroup><tbody>
</tbody>

Thanks a ton!
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi,

Not exactly clear on what you want.

If you want a Separate count for each Year/Column, then use H1 formula (change range for the other column).
If you want a Combined count for both Year/Columns, then use I1 formula.


Book1
ABCDEFGHI
1Member IDPrevious ValueCategoryCurrent ValueCategoryRisk Movement54
2IDXX115Good115GoodNo Movement
3IDxx178Too High178Too HighNo Movement
4ID123143Borderline143BorderlineNo Movement
5ID1234108Good101GoodNo Movement
6ID12345100GoodUnknown
Sheet54
Cell Formulas
RangeFormula
H1=SUM(COUNTIFS(C2:C6,{"Good","Borderline","Too High"}))
I1=SUM(COUNTIFS(C2:C6,{"Good","Borderline","Too High"},E2:E6,{"Good","Borderline","Too High"}))
 
Upvote 0
I need the Good, Borderline and Too High Count for each year but only the years that have values for each year. So for example, on line 6 - I would not count the Good for column C because Year 2 Column F is unknown. Does that make sense?
 
Last edited:
Upvote 0
Basically I need to count each Good, Borderline, and Too High - but ONLY if there is data for each year. If there is an unknown for either of the years, then I do not want to count the data in either year. I am only assessing values that have available data in both years.
 
Upvote 0
If the I1 formula in my post #2 is not doing what you're describing, please show sample results, then I can adjust the formula.
 
Upvote 0
Thanks for the reply jtakw - I ended up using a few array formulas to do the the job:

SUM(COUNTIFS($L$2:$L$1000,{"Good"},$N$2:$N$1000,{"Good";"Too High";"Borderline"}))

I swapped out Good, Too High and Borderline for the formulas that followed.
 
Upvote 0
Still not sure what you want, but Glad you've got it working.

The formula you posted seems like a Regular formula rather than an array formula...
 
Upvote 0

Forum statistics

Threads
1,215,695
Messages
6,126,263
Members
449,307
Latest member
Andile

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