Multiple countifs within 2 if functions

mtaylor

Board Regular
Joined
May 1, 2013
Messages
73
Platform
  1. Windows
  2. MacOS
Hi folks,

I am working on a register for online students.

Over the course of a day (7 lessons), if a student has more than 3 'TRUE', 'R' or 'L' values between D4 and J4 a 'P' appears, if a student has more than 2 'AA' values between D4 and J4 a 'AA' appears, if neither of these apply a 'UA' appears.

The 'true', 'r' and 'l' must take preference over the 'aa'

I currently have this:

=IF(COUNTIF(D4:J4,TRUE)+(COUNTIF(D4:J4,"R")+(COUNTIF(D4:J4,"L")))>3,"P",IF(COUNTIF(D4:J4,"AA")))>2,"AA""UA"

It doesn't work

Thank you in advance,

I hope I'm making sense?
 

Excel Facts

Last used cell?
Press Ctrl+End to move to what Excel thinks is the last used cell.
But I think Brackets and , are missing

=IF(COUNTIF(D4:J4,TRUE)+(COUNTIF(D4:J4,"R")+(COUNTIF(D4:J4,"L")))>3,"P",IF(COUNTIF(D4:J4,"AA")))>2,"AA""UA"

COUNTIF(D4:J4,TRUE)+(COUNTIF(D4:J4,"R")+(COUNTIF(D4:J4,"L")))>3
should be
(COUNTIF(D4:J4,TRUE)+(COUNTIF(D4:J4,"R")+(COUNTIF(D4:J4,"L"))>3
This will TEST ALL the additions of the COUNTIF

SO
=IF((COUNTIF(D4:J4,TRUE)+COUNTIF(D4:J4,"R")+COUNTIF(D4:J4,"L"))>3,"P",IF((COUNTIF(D4:J4,"AA"))>2,"AA","UA"))
 
Upvote 0
Solution
But I think Brackets and , are missing

=IF(COUNTIF(D4:J4,TRUE)+(COUNTIF(D4:J4,"R")+(COUNTIF(D4:J4,"L")))>3,"P",IF(COUNTIF(D4:J4,"AA")))>2,"AA""UA"

COUNTIF(D4:J4,TRUE)+(COUNTIF(D4:J4,"R")+(COUNTIF(D4:J4,"L")))>3
should be
(COUNTIF(D4:J4,TRUE)+(COUNTIF(D4:J4,"R")+(COUNTIF(D4:J4,"L"))>3
This will TEST ALL the additions of the COUNTIF

SO
=IF((COUNTIF(D4:J4,TRUE)+COUNTIF(D4:J4,"R")+COUNTIF(D4:J4,"L"))>3,"P",IF((COUNTIF(D4:J4,"AA"))>2,"AA","UA"))
Brilliant - Many thanks
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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