Count formula

ashani

Active Member
Joined
Mar 14, 2020
Messages
345
Office Version
  1. 365
Platform
  1. Windows
Hi experts,

I'm looking for a guidance regarding the below formula - currently it counts how many incorrects are there however what I want is : Between E30:M30 - however many incorrects selected take one off so for example if 8 columns selected as incorrect than it should show 7. However, if all of them showing as correct than it should show 0 (zero).

VBA Code:
=IF(IF(COUNTIF(E30:M30,"N/A")=COUNTA(E30:M30)+COUNTBLANK(E30:M30),1,0)=1,"",IF(COUNTBLANK(E30:M30)>0,"",COUNTIF(E30:M30,"Incorrect")))

Many thanks,
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Sounds like you want:

MAX(0,COUNTIF(E30:M30,"Incorrect")-1)
 
Upvote 0
Hi @RoryA
Thank you for the prompt response. It's working fine - the only issue is if E30:M30 is blank than it's still showing "0" - any chance it only show number when every column in that range is filled either with correct/incorrect and if all blank than leave it blank.

Thanks,
 
Upvote 0
If they are all blank then the first part of your formula should already be taking care of that.
 
Upvote 0

Forum statistics

Threads
1,214,986
Messages
6,122,611
Members
449,090
Latest member
vivek chauhan

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