Count cells that meet 2 IF Conditions

TheRedCardinal

Board Regular
Joined
Jul 11, 2019
Messages
243
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi all,

I want to count the number of rows for which 2 simple logical tests are met.

My data is in range A4:F114.

What I want to do is count how many times:

  1. The first 7 characters in column B are "Prepare"
  2. The value of column F is "On Time"
I worked out how to the first bit using an array formula:

Excel Formula:
=COUNT(IF(LEFT(B4:B114,7)="Prepare",1,""))

(I also need to know how many times just column B shows Prepare)

I then tried to expand this using an IF/AND combination:

Excel Formula:
=COUNT(IF(AND(LEFT(B4:B114,7)="Prepare",F4:F114="On Time"),1,""))

But this is returning a zero for me even though the condition is met 27 times.

So what obvious step have I missed?

Thanks!
 

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

Forum statistics

Threads
1,215,408
Messages
6,124,727
Members
449,185
Latest member
ekrause77

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