Counting cells based on a result of a formula in another cell

Aaargh

New Member
Joined
Jun 29, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
I have tried various different ways to come up with a formula that will work. Basically, I have a column that lists dates. I have another column that I use the following formula: =IF(C1>=DATE(2023,8,31),"NO","YES") I am wanting to have excel total the number of "YES" results in that column. I am not sure the best route to go. I have tried using =COUNTIF(C1:C1500,"YES") but the formula does not count. It is giving me a zero sum. I should add that my column with the =IF(C1>=DATE(2023,8,31),"NO","YES") has conditional formatting that changes the color of the font based on whether it is a yes or no; but I do not believe that would effect the results. So, my question is what formula will provide me with an automatic calculation of my column based on the result of another formula? I want to count my "YES"s.
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
Welcome to the Board!

Are you counting the right column?
If your formula is:
Excel Formula:
=IF(C1>=DATE(2023,8,31),"NO","YES")
I am guessing you are putting this formula in column B or D.

However, your COUNTIF function is counting column C:
Excel Formula:
=COUNTIF(C1:C1500,"YES")
Change the range in that formula to the column with the "YES" and "NO" values.
 
Upvote 0
Welcome to the Board!

Are you counting the right column?
If your formula is:
Excel Formula:
=IF(C1>=DATE(2023,8,31),"NO","YES")
I am guessing you are putting this formula in column B or D.

However, your COUNTIF function is counting column C:
Excel Formula:
=COUNTIF(C1:C1500,"YES")
Change the range in that formula to the column with the "YES" and "NO" values.
Thank you for the comment! I was in the correct column. My original message showed the incorrect cell reference for the =IF(C1>=DATE(2023,8,31), "NO","YES") was in column D and then my =COUNTIF(D1:D1500, "YES") would give me a result of 0. I had to do a little research, but found that the following formula provided the correct answer. =COUNTIF($D$1:$D$1500,"*YES*"). The COUNTIF formula needed the * inserted around the word "YES" for it to work.
 
Upvote 0
Thank you for the comment! I was in the correct column. My original message showed the incorrect cell reference for the =IF(C1>=DATE(2023,8,31), "NO","YES") was in column D and then my =COUNTIF(D1:D1500, "YES") would give me a result of 0. I had to do a little research, but found that the following formula provided the correct answer. =COUNTIF($D$1:$D$1500,"*YES*"). The COUNTIF formula needed the * inserted around the word "YES" for it to work.
If "*YES*" works, but "YES" does not, that means that the values in those cells are NOT exactly equal to "YES", that you must have extra characters in there along with the word "YES".
Perhaps you have an extra space in there or some other special character.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

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