COUNTIF FUNCTION DOESN'T WORK IN TABLE FORMAT WITH ENTRY FORM

%3CLINGO-SUB%20id%3D%22lingo-sub-2163958%22%20slang%3D%22en-US%22%3ECOUNTIF%20FUNCTION%20DOESN'T%20WORK%20IN%20TABLE%20FORMAT%20WITH%20ENTRY%20FORM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2163958%22%20slang%3D%22en-US%22%3E%3CP%3EI%20am%20working%20on%20a%20spreadsheet%20to%20build%20a%20simple%20billing%20system%20for%20my%20son's%20business.%26nbsp%3B%20He%20is%20not%20at%20all%20proficient%20with%20Excel.%26nbsp%3B%20I%20am%20wanting%20to%20use%20the%20COUNTIF%20function%20to%20count%20the%20running%20occurrences%20of%20a%20text%20entry%20in%20a%20column.%26nbsp%3B%20i.e.%26nbsp%3B%20The%20first%20time%20it%20comes%20up%20it%20will%20return%20a%201%2C%20the%20second%20a%202%2C%20the%20third%20a%20three%20and%20so%20on.%26nbsp%3B%20It%20works%20well%20in%20a%20spreadsheet.%26nbsp%3B%20However%2C%20when%20I%20go%20to%20the%20table%20format%20and%20use%20the%20entry%20form%2C%20when%20I%20input%20a%20new%20row%2C%20it%20changes%20the%20rows%20above%20and%20puts%20the%20total%20count%20in%20those%20rows.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20for%20discussion%20suppose%20I%20have%20a%20spreadsheet%20with%20two%20columns%20A%20and%20B.%26nbsp%3B%20A%20will%20be%20text%20and%20B%20will%20be%20my%20function%3A%26nbsp%3B%20%26nbsp%3B%3DCOUNTIF(%24A%241%3AA1%2C%20A1)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20works%20fine%20in%20the%20spreadsheet%20form.%26nbsp%3B%20Let's%20make%20it%20simple.%26nbsp%3B%20Here%20is%20the%20result%20in%20a%20small%20sheet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EColumn%20A%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Column%20B%3C%2FP%3E%3CP%3EAAA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B1%3C%2FP%3E%3CP%3EBBB%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201%3C%2FP%3E%3CP%3ECCC%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B1%3C%2FP%3E%3CP%3EDDD%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201%3C%2FP%3E%3CP%3EAAA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B2%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20continue%20to%20put%20in%20AAA%20and%20drag%20down%20the%20function%20it%20will%20count%20up%2C%203%2C%204%20so%20forth.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%20if%20I%20go%20to%20a%20table%20and%20then%20use%20an%20entry%20form%20and%20put%20in%20AAA%2C%20here%20is%20what%20I%20will%20get.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EColumn%20A%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20Column%20B%3C%2FP%3E%3CP%3EAAA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B1%3C%2FP%3E%3CP%3EBBB%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201%3C%2FP%3E%3CP%3ECCC%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B1%3C%2FP%3E%3CP%3EDDD%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%201%3C%2FP%3E%3CP%3EAAA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B3%26nbsp%3B%20%26nbsp%3B%20%26lt%3B-------------------%3C%2FP%3E%3CP%3EAAA%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B3%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20spreadsheet%20this%20would%20stay%26nbsp%3B%3DCOUNTIF(%24A%241%3AA5%2C%20A5)%20and%20give%20a%202.%26nbsp%3B%20But%20in%20the%20table%20format%20when%20I%20have%20entered%20the%20next%20AAA%20it%20will%20become%20%3DCOUNTIF(%24A%241%3AA6%2C%20A6)%20and%20be%20a%203%20as%20I%20show%20here.%26nbsp%3B%20Entering%20more%20AAA%20entries%20will%20change%20the%20bottom%20two%20to%204%20and%20then%20to%205%20and%20so%20forth.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20spent%204%20hours%20on%20a%20chat%20with%204%20different%20people%20with%20microsoft%20and%20they%20gave%20up%20and%20said%20that%20I%20should%20just%20drag%20down%20the%20function%20every%20time.%26nbsp%3B%20That%20just%20negates%20any%20reason%20to%20have%20an%20entry%20form.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20anyone%20help%3F%26nbsp%3B%20Thanks.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFrustrated%20in%20Illinois%2C%3C%2FP%3E%3CP%3EDennis1951%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2163958%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2164248%22%20slang%3D%22en-US%22%3ERe%3A%20COUNTIF%20FUNCTION%20DOESN'T%20WORK%20IN%20TABLE%20FORMAT%20WITH%20ENTRY%20FORM%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2164248%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F977891%22%20target%3D%22_blank%22%3E%40Dennis1951%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20believe%20that%20is%20a%20feature%2C%20and%20not%20an%20error.%20One%20of%20the%20main%20benefits%20of%20using%20tables%20is%20formulas%20that%20reference%20a%20table%20column%20will%20auto-update%20when%20the%20table%20is%20resized.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%2C%20in%20another%20cell%20on%20your%20worksheet%2C%20you%20had%20%3DSUM(B2%3AB7)%20and%20then%20resized%20your%20table%20to%20add%20another%20row%2C%20then%20your%20sum%20formula%20would%20update%20to%20%3DSUM(B2%3AB8)%2C%20which%20is%20a%20desirable%20feature.%20In%20your%20case%2C%20the%20last%20row%20of%20your%20table%20is%20referencing%20an%20entire%20column%20of%20the%20table%20and%20is%20getting%20updated%20as%20well%20(it%20doesn't%20appear%20to%20discriminate%20between%20updating%20formulas%20outside%20the%20table%20and%20within%20the%20table).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20suggest%20using%20structured%20table%20references%20instead%20of%20A1%20notation%3A%3C%2FP%3E%3CP%3E%3DCOUNTIF(INDEX(%5BColumn%20A%5D%2C1)%3A%5B%40%5BColumn%20A%5D%5D%2C%5B%40%5BColumn%20A%5D%5D)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

I am working on a spreadsheet to build a simple billing system for my son's business.  He is not at all proficient with Excel.  I am wanting to use the COUNTIF function to count the running occurrences of a text entry in a column.  i.e.  The first time it comes up it will return a 1, the second a 2, the third a three and so on.  It works well in a spreadsheet.  However, when I go to the table format and use the entry form, when I input a new row, it changes the rows above and puts the total count in those rows.  

 

Just for discussion suppose I have a spreadsheet with two columns A and B.  A will be text and B will be my function:   =COUNTIF($A$1:A1, A1)

 

It works fine in the spreadsheet form.  Let's make it simple.  Here is the result in a small sheet.

 

Column A      Column B

AAA                     1

BBB                      1

CCC                     1

DDD                    1

AAA                     2

 

If I continue to put in AAA and drag down the function it will count up, 3, 4 so forth.

 

But if I go to a table and then use an entry form and put in AAA, here is what I will get.  

 

Column A      Column B

AAA                     1

BBB                      1

CCC                     1

DDD                    1

AAA                     3    <-------------------

AAA                     3

 

In the spreadsheet this would stay =COUNTIF($A$1:A5, A5) and give a 2.  But in the table format when I have entered the next AAA it will become =COUNTIF($A$1:A6, A6) and be a 3 as I show here.  Entering more AAA entries will change the bottom two to 4 and then to 5 and so forth.

 

I spent 4 hours on a chat with 4 different people with microsoft and they gave up and said that I should just drag down the function every time.  That just negates any reason to have an entry form.

 

Can anyone help?  Thanks.

 

Frustrated in Illinois,

Dennis1951

1 Reply

@Dennis1951 

 

I believe that is a feature, and not an error. One of the main benefits of using tables is formulas that reference a table column will auto-update when the table is resized.

 

If, in another cell on your worksheet, you had =SUM(B2:B7) and then resized your table to add another row, then your sum formula would update to =SUM(B2:B8), which is a desirable feature. In your case, the last row of your table is referencing an entire column of the table and is getting updated as well (it doesn't appear to discriminate between updating formulas outside the table and within the table).

 

I would suggest using structured table references instead of A1 notation:

=COUNTIF(INDEX([Column A],1):[@[Column A]],[@[Column A]])