Home

Formula help

%3CLINGO-SUB%20id%3D%22lingo-sub-680291%22%20slang%3D%22en-US%22%3EFormula%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-680291%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20there%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20spreadsheet%20with%20various%20columns%20of%20data%20that%20I%20need%20to%20be%20able%20to%20count%20up%20but%20my%20countifs%20formula%20doesn't%20count%20the%20blanks%20so%20I%20need%20to%20be%20able%20to%20replace%20the%20blanks%20with%20F%2C%20for%20example%20but%20it%20needs%20to%20leave%20any%20value%20already%20entered.%26nbsp%3B%20I%20can%20then%20use%20the%20F%20in%20the%20countifs%20formula.%26nbsp%3B%20It%20has%20to%20be%20a%20formula%20so%20that%20it%20can%20then%20be%20copied%20down%20to%20all%20other%20rows%20of%20data%20using%20a%20macro.%26nbsp%3B%20This%20is%20so%20that%20I%20can%20ultimately%20count%20pupils%20who%20are%20not%20assigned%20in%20more%20than%20one%20category%20only%20once.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAny%20help%20would%20be%20much%20appreciated.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20in%20advance%2C%3C%2FP%3E%3CP%3EFiona%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-680291%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-680339%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-680339%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F234595%22%20target%3D%22_blank%22%3E%40Fiona%20Sawyers%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAssuming%20a%20situation%20where%20you%20wish%20to%20count%20the%20number%20of%20records%20in%20a%20list%20that%20match%20%22A%22%26nbsp%3B%3C%2FP%3E%3CP%3E%3D%20COUNTIFS(%20List%2C%20%22A%22%20)%3C%2FP%3E%3CP%3Eyou%20can%20include%20the%20records%20with%20a%20blank%20by%20adding%3C%2FP%3E%3CP%3E%3D%20COUNTIFS(%20List%2C%20%22%22%20)%3C%2FP%3E%3CP%3EYou%20could%20also%20combine%20the%20two%20terms%20using%20an%20array%3C%2FP%3E%3CP%3E%3D%20SUM(%20COUNTIFS(%20List%2C%20%7B%22A%22%2C%22%22%7D%20)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20this%20what%20you%20need%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-680716%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-680716%22%20slang%3D%22en-US%22%3E%3CP%3EHi%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20this%20but%20I%20can't%20make%20it%20work%20unfortunately%2C%20not%20sure%20if%20I'm%20just%20doing%20it%20wrong!%26nbsp%3B%20It%20is%20counting%20all%20blanks%2C%20not%20just%20the%20blanks%20for%20the%20number%20of%20rows%20where%20I%20have%20data%20so%20it%20wouldn't%20be%20usable%20for%20what%20I%20need.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20a%20list%20of%20pupil%20names%20and%20whether%20they%20are%20EAL%2C%20SEN%2C%20FSM%2C%20PPI%20etc%20and%20I%20need%20to%20be%20able%20to%20count%20how%20many%20pupils%20meet%20the%20criteria%20of%20being%20non-EAL%2C%20which%20could%20be%20%22No%22%20or%20blank%2C%20non-SEN%2C%20which%20could%20be%20%22N%22%20or%20blank%20and%20non-PPI%20which%20will%20be%20F.%26nbsp%3B%20If%20a%20pupil%20meets%20all%203%20criteria%20I%20need%20them%20counting%20only%20once.%26nbsp%3B%20I%20also%20need%20to%20be%20able%20to%20count%20pupils%20who%20are%20non-EAL%20and%20non-SEN%2C%20again%20only%20counting%20the%20pupil%20once.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EFiona%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20I'm%20making%20sense%2C%20I%20don't%20know%20how%20else%20to%20describe%20what%20I%20need.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-681467%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-681467%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F234595%22%20target%3D%22_blank%22%3E%40Fiona%20Sawyers%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20might%20be%20worth%20posting%20a%20sample%20workbook%20(no%20actual%20pupil%20names)%20so%20that%20the%20requirement%20can%20be%20better%20understood.%26nbsp%3B%20I%20prefer%20using%20Excel%20tables%20to%20hold%20the%20data%20with%20no%20blank%20rows%20and%20formula%20references%20that%20do%20not%20extend%20beyond%20the%20actual%20data.%26nbsp%3B%20I%20appreciate%20there%20are%20other%20working%20practices%20though.%26nbsp%3B%20To%20ignore%20blank%20records%20you%20will%20need%20a%20further%20criterion%20in%20the%20COUNTIFS%20that%20tests%20whether%20the%20student%20name%2FID%20is%20present.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20OR%20condition%2C%20achieved%20by%20an%20array%20of%20evaluations%20and%20committed%20with%20Ctrl%2BShift%2BEnter%2C%20is%20not%20a%20basic%20technique%20and%20needs%20to%20be%20used%20with%20care%2C%20especially%20if%20more%20than%20one%20criterion%20has%20multiple%20options.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20key%20to%20your%20acronyms%20might%20help%20too%3B%20I%20am%20familiar%20with%20SEN%20and%20have%20sorted%20EAL%20(not%20so%20common%20in%20the%20leafy%20suburbs)%20but%20I%20have%20still%20to%20find%20my%20way%20through%20the%20rest%20of%20the%20educational%20terms.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-682428%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-682428%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F214174%22%20target%3D%22_blank%22%3E%40Peter%20Bartholomew%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Peter%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI've%20been%20thinking%20about%20this%20and%20I%20think%20the%20best%20way%20round%20it%20for%20me%20is%20to%20use%20the%20other%20information%20I%20have%20to%20get%20the%20data%20I%20need.%26nbsp%3B%20Using%20an%20array%20of%20cells%20won't%20work%20as%20such%20because%20each%20time%20the%20report%20is%20run%20there%20may%20be%20a%20different%20number%20of%20rows.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20I%20have%20decided%20to%20do%20is%20use%20the%20number%20of%20pupils%20with%20EAL%2C%20SEN%20and%20PPI%20then%20minus%20it%20from%20the%20total%20to%20give%20me%20the%20data%20for%20those%20that%20don't%20have%20any.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20for%20your%20help%20Peter.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%3C%2FP%3E%3CP%3EFiona%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-684913%22%20slang%3D%22en-US%22%3ERe%3A%20Formula%20help%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-684913%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F234595%22%20target%3D%22_blank%22%3E%40Fiona%20Sawyers%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan't%20fault%20the%20logic%20provided%20you%20ensure%20that%20you%20do%20not%20count%20multiple%20issues%20that%20impact%20the%20same%20pupil.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EA%20different%20numbers%20of%20rows%20is%20not%20necessarily%20a%20problem%20provided%20you%20use%20dynamic%20references%20that%20allow%20for%20such%20changes.%26nbsp%3B%20Tables%20and%20structured%20references%20probably%20offer%20the%20best%20solution%20but%20there%20are%20traditional%20techniques%20of%20counting%20and%20using%20OFFSET%20with%20the%20count%20that%20also%20work.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Fiona Sawyers
Occasional Contributor

Hi there,

 

I have a spreadsheet with various columns of data that I need to be able to count up but my countifs formula doesn't count the blanks so I need to be able to replace the blanks with F, for example but it needs to leave any value already entered.  I can then use the F in the countifs formula.  It has to be a formula so that it can then be copied down to all other rows of data using a macro.  This is so that I can ultimately count pupils who are not assigned in more than one category only once.

 

Any help would be much appreciated.

 

Thanks in advance,

Fiona

5 Replies

@Fiona Sawyers 

Assuming a situation where you wish to count the number of records in a list that match "A" 

= COUNTIFS( List, "A" )

you can include the records with a blank by adding

= COUNTIFS( List, "" )

You could also combine the two terms using an array

= SUM( COUNTIFS( List, {"A",""} )

 

Is this what you need?

Hi@Peter Bartholomew ,

 

Thanks for this but I can't make it work unfortunately, not sure if I'm just doing it wrong!  It is counting all blanks, not just the blanks for the number of rows where I have data so it wouldn't be usable for what I need.

 

I have a list of pupil names and whether they are EAL, SEN, FSM, PPI etc and I need to be able to count how many pupils meet the criteria of being non-EAL, which could be "No" or blank, non-SEN, which could be "N" or blank and non-PPI which will be F.  If a pupil meets all 3 criteria I need them counting only once.  I also need to be able to count pupils who are non-EAL and non-SEN, again only counting the pupil once.

 

Regards,

Fiona

 

I hope I'm making sense, I don't know how else to describe what I need.

@Fiona Sawyers 

It might be worth posting a sample workbook (no actual pupil names) so that the requirement can be better understood.  I prefer using Excel tables to hold the data with no blank rows and formula references that do not extend beyond the actual data.  I appreciate there are other working practices though.  To ignore blank records you will need a further criterion in the COUNTIFS that tests whether the student name/ID is present.

 

The OR condition, achieved by an array of evaluations and committed with Ctrl+Shift+Enter, is not a basic technique and needs to be used with care, especially if more than one criterion has multiple options.

 

A key to your acronyms might help too; I am familiar with SEN and have sorted EAL (not so common in the leafy suburbs) but I have still to find my way through the rest of the educational terms.

@Peter Bartholomew 

 

Hi Peter,

 

I've been thinking about this and I think the best way round it for me is to use the other information I have to get the data I need.  Using an array of cells won't work as such because each time the report is run there may be a different number of rows.

 

What I have decided to do is use the number of pupils with EAL, SEN and PPI then minus it from the total to give me the data for those that don't have any.

 

Thanks for your help Peter.

 

Regards,

Fiona

@Fiona Sawyers 

Can't fault the logic provided you ensure that you do not count multiple issues that impact the same pupil. 

 

A different numbers of rows is not necessarily a problem provided you use dynamic references that allow for such changes.  Tables and structured references probably offer the best solution but there are traditional techniques of counting and using OFFSET with the count that also work.