Counting against merged and non-merged cells

%3CLINGO-SUB%20id%3D%22lingo-sub-1405929%22%20slang%3D%22en-US%22%3ECounting%20against%20merged%20and%20non-merged%20cells%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1405929%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20a%20problem%20trying%20to%20sequentially%20count...%20in%20the%20following%20example%2C%20you%20can%20see%20that%20column%20B%20is%20correct%20to%20count%20and%20show%2014%20items%20-%20and%20these%2014%20items%20are%20allocated%20to%20its%20own%20country%20(we%20can%20see%20there%20are%207%20countries)%20I%20merged%20the%20items%20within%20their%20respective%20countries%20(No%2C%20it%20will%20never%20be%20sorted%20-%20but%20can%20have%20future%20items%20inserted%20within%20each%20country).%20Column%20A%20shows%20the%20merged%20cells%2C%20if%20any%2C%20for%20each%20country's%20items.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20the%20attached%20example%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20using%20the%20%22%3D%2BB2%2B1%22%20in%20B3%20cell%20and%20so%20on%20which%20is%20correct...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBut%2C%20in%20column%20A%2C%20it%20is%20way%20off%20with%20the%20merged%20and%20non-merged%20cells%20because%20the%20cell%20references%20are%20not%20pointing%20to%20the%20correct%20previous%20cell%2C%20be%20it%20merged%20or%20not.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20hope%20there%20is%20a%20solution%20to%20this...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you!!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EKenneth%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1405929%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-1406079%22%20slang%3D%22en-US%22%3ERe%3A%20Counting%20against%20merged%20and%20non-merged%20cells%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1406079%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F186361%22%20target%3D%22_blank%22%3E%40Kenneth%20Rothschild%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%2C%20for%20future%20reference%2C%20it's%20actually%20a%20lot%20more%20helpful%20if%20you%20upload%20the%20actual%20spreadsheet%2C%20rather%20than%20just%20an%20image.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESecond%2C%20the%20solution%20(or%20%22A%20solution%22)%20that%20works%20with%20the%20newest%20versions%20of%20Excel--which%20I%20hope%20you%20have--is%20this%20formula%20in%20Cell%20A1.%20No%20need%20to%20copy%20it%20down%20to%20cells%2C%20merged%20or%20otherwise.%3C%2FP%3E%3CP%3E%3CSTRONG%3E%3DCOUNTA(UNIQUE(C2%3AC15))%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThat%20said%2C%20you're%20generally%20going%20to%20be%20better%20off%20NOT%20merging%20cells%20as%20you've%20done%20here.%20In%20effect%2C%20you're%20doing%20manually%20something%20that%20might%20make%20it%20easier%20to%20visually%20differentiate%2C%20as%20a%20new%20Country%20enters%20the%20picture%2C%20but%20what%20happens%20if%2Fwhen%3A%3C%2FP%3E%3CUL%3E%3CLI%3EItaly%20adds%20another%20item%3C%2FLI%3E%3CLI%3EUSA%20deletes%20a%20row%3C%2FLI%3E%3CLI%3Eetc.%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20formula%20I%20gave%20you%20doesn't%20work%2C%20come%20back%20and%20we'll%20give%20you%20a%20different%20way%20to%20do%20it%20that%20is%20less%20elegant%20but%20works.....%20but%20please%20do%20away%20with%20the%20merged%20cells%20first.%20And%20upload%20the%20spreadsheet%20itself.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I'm having a problem trying to sequentially count... in the following example, you can see that column B is correct to count and show 14 items - and these 14 items are allocated to its own country (we can see there are 7 countries) I merged the items within their respective countries (No, it will never be sorted - but can have future items inserted within each country). Column A shows the merged cells, if any, for each country's items.  

 

In the attached example

 

I'm using the "=+B2+1" in B3 cell and so on which is correct...

 

But, in column A, it is way off with the merged and non-merged cells because the cell references are not pointing to the correct previous cell, be it merged or not.

 

I hope there is a solution to this...

 

Thank you!!!

 

Kenneth

 

1 Reply
Highlighted

@Kenneth Rothschild 

First, for future reference, it's actually a lot more helpful if you upload the actual spreadsheet, rather than just an image.

 

Second, the solution (or "A solution") that works with the newest versions of Excel--which I hope you have--is this formula in Cell A1. No need to copy it down to cells, merged or otherwise.

=COUNTA(UNIQUE(C2:C15))

 

That said, you're generally going to be better off NOT merging cells as you've done here. In effect, you're doing manually something that might make it easier to visually differentiate, as a new Country enters the picture, but what happens if/when:

  • Italy adds another item
  • USA deletes a row
  • etc.

 

If the formula I gave you doesn't work, come back and we'll give you a different way to do it that is less elegant but works..... but please do away with the merged cells first. And upload the spreadsheet itself.