View Single Post
  #17   Report Post  
Posted to microsoft.public.excel.worksheet.functions
wissam wissam is offline
external usenet poster
 
Posts: 23
Default calculate percent between 10.0 and 12.0 for data in multiple s

I believe that the following snippet fixes my problem so that it would
pastspecial value:

..ListObjects(1).ListColumns(j).DataBodyRange.Copy

Sheets(ss).ListObjects(1).ListColumns(i).DataBodyR ange.Cells(u).PasteSpecial
(xlPasteValuesAndNumberFormats)
Application.CutCopyMode = False

The current function to get the percentage of table10[hemoglobin] with
values between Table11[lo] and Table11[high]is as follows:

=COUNTIFS(Table10[Type],[Type],INDIRECT("Table10["&Table12[#Headers]&"]"),"="&INDEX(Table11[Lo],rown),INDIRECT("Table10["&Table12[#Headers]&"]"),"<="&INDEX(Table11[Hi],rown))/COUNTIFS(Table10[Type],[Type])

The denominator in the above function currently counts all cells in the
column (even empty ones). For instance, in table10 shown below, for month of
Jan, % of hemoglobin values between 10 and 12 is 50%. How do I change the
denominator in the above function so that it count cells that only have
numbers (i.e do not count cell into the denominator for that month if cell is
empty; as such, the percentage would become 100%)?

Table10
Type Jan Feb Mar Apr May
albumin 3.5 3.5 3.3 3.5 3.1
aluminum 3.6 3.5 3.3 3.3 3.5
Aluminum 5
hemoglobin 10.7 10.8 11.3
hemoglobin 10.5 9.8 11.0 11.2

Thank you very much.



"Herbert Seidenberg" wrote:

The code snippet you appropriately quoted has been superseded
by new code in the CloudFile link.
The CaxP formula has been added as a demo.
The code in the MediaFire link has not been edited.
It still copies formulas.

.