Adding a criteria to a countif formule

Marvo

Board Regular
Joined
Nov 27, 2023
Messages
155
Office Version
  1. 2021
Platform
  1. Windows
Hi All, Can I add a criteria to a COUNTIF formula, I guess making it a COUNTIFS?

I have

=COUNTIF(ALL!$C:$C,K61)

however I only want it to count down COLUMN C as far as data is entered in the adjacent COLUMN F.

I tried =COUNTIFS(ALL!$C:$C,K61,ALL!$F:$F,"<>") but needless to say that didn't work.

Any help much appreciated.
 

Attachments

  • excel.JPG
    excel.JPG
    90.5 KB · Views: 8

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Did you mean column F or the column headed F (goals for)?
 
Upvote 0
that should work
BUT not sure what you are counting and the criteria in the image

for example simple mockup
K61 has a in

Book4
AB
132
Sheet1
Cell Formulas
RangeFormula
A1A1=COUNTIF(ALL!$C:$C,K61)
B1B1=COUNTIFS(ALL!$C:$C,K61,ALL!$F:$F,"<>")


Book4
ABCDEF
1
2a1
3
4
5a
6
7
8
9a1
10
11
ALL
 
Upvote 0
What I am doing is counting how many games are being played on days of the week. Column C.

The problem is the fixtures are entered until the end of the season so the formula is counting those games that haven't yet been played.

I thought I could solve this by adding the criteria that only count down Column C as far as when a score is entered into Column F.

(There maybe a better solution but that is what I came up with)
 
Upvote 0
so the venue F will be Blank -
should work - check that the cells in F are actually blank and do not have a space in
??? column K is blank or column O attendance is blank

Note: Images are difficult to see , and also requires that I input all the data myself, which means I may make an error, which is very time consuming, and from my point of view less likely to get a response, if a complicated spreadsheet. Plus we cannot see any of the formulas used.

Therefore -

A SMALL sample spreadsheet, around 10-20 rows, would help a lot here, with all sensitive data removed, and expected results mocked up and manually entered, with a few notes of explanation.

This will possibly enable a quicker and more accurate solution for you.

MrExcel has a tool called “XL2BB” that lets you post samples of your data and will allow us to copy/paste your sample data into our Excel spreadsheets, saving a lot of time.

You can also test to see if it works ok, in the "Test Here" forum.

OR if you cannot get XL2BB to work, or have restrictions on your PC

then put the sample spreadsheet onto a share

I only tend to goto OneDrive, Dropbox or google docs , as I'm never certain of other random share sites and possible virus.
Please make sure you have a representative data sample and also that the data has been desensitised, remember this site is open to anyone with internet access to see - so any sensitive / personal data should be removed

Make sure you set any share or google to share to everyone
 
Upvote 0
You're right, I do apologise, the solution I came up with does indeed work if I'd entered the correct column in. Sorry for being a complete idiot and wasting everybody's time.
 
Upvote 0

Forum statistics

Threads
1,215,069
Messages
6,122,958
Members
449,096
Latest member
Anshu121

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