Hi,
I would like to ask you for help with macro or custom function for this.
Calculate average for n cell and exclude 0, blank cells, -, text. Every time is different amount of calculated cells.
How to write macro or custom function.
My try is here but it is only for 2 calculating cell and Macro doesn´t work:
Thank you for your help.
I would like to ask you for help with macro or custom function for this.
Calculate average for n cell and exclude 0, blank cells, -, text. Every time is different amount of calculated cells.
How to write macro or custom function.
My try is here but it is only for 2 calculating cell and Macro doesn´t work:
Code:
Sub Averageee()
Dim myValue As Range
Dim myValuee As Range
Set myValue = Application.InputBox("Cell No.1", Type:=8)
Set myValuee = Application.InputBox("Cell No.2", Type:=8)
ActiveCell.Formula = "=(SUM(SUMIF(" & myValue & ",<>0),SUMIF(" & myValuee & ",<>0)))/SUM(COUNTIF(" & myValue & ",>0),COUNTIF(" & myValuee & ",>0))"
ActiveCell.Select
End Sub
Thank you for your help.