ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   Merging Cells but have each cell counted in the range of merged c. (https://www.excelbanter.com/excel-worksheet-functions/6026-merging-cells-but-have-each-cell-counted-range-merged-c.html)

gats13

Merging Cells but have each cell counted in the range of merged c.
 
I'm trying to figure out a formula that will count each cell in a range of
merged cells as having the same text as the 1st cell in the range.

Frank Kabel

Hi
try something like
=COUNTIF(A2:A20,A1)

--
Regards
Frank Kabel
Frankfurt, Germany

"gats13" schrieb im Newsbeitrag
...
I'm trying to figure out a formula that will count each cell in a

range of
merged cells as having the same text as the 1st cell in the range.



Bernie Deitrick

Gats,

You would need to use a user-defined-function, given below. Copy and paste
the code into a codemodule, and use it like

=mySum(A1:D4)

HTH,
Bernie
MS Excel MVP

Function mySum(inRange As Range) As Double
Dim myCell As Range
Dim myMC As Range
For Each myCell In inRange
For Each myMC In myCell.MergeArea
mySum = mySum + myMC.Value
Next myMC
Next myCell

End Function


"gats13" wrote in message
...
I'm trying to figure out a formula that will count each cell in a range of
merged cells as having the same text as the 1st cell in the range.





All times are GMT +1. The time now is 05:54 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com