Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 192
Default calculate percentage of cells that have any value

Try the following. Replace "A1" for where your values start. Hope this helps!


Option Explicit
Sub percentnumeric()

Dim cell As Range
Dim i, j As Long

i = 0
j = 0

For Each cell In Range(Range("A1"), Range("A1").End(xlDown))
If IsNumeric(cell) And cell < "" Then i = i + 1
j = j + 1
Next cell

MsgBox (i & "/" & j & " have numeric values. This is " & i / j * 100 & "%.")

End Sub
--
-SA


"JLeck" wrote:

I have a column of numbers, and I want to calculate how many rows have a
non-blank in them. Regardless of the value in the cells, I want to know what
percentage HAVE a (numeric) value. How do I do that? Thanks.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I calculate an average by a certain percentage? cwilson Excel Worksheet Functions 1 September 11th 06 12:33 AM
Calculate percentage based on cells with conditional formatting Cachod1 New Users to Excel 5 April 4th 05 02:11 PM
calculate percentage JP Excel Worksheet Functions 6 March 2nd 05 02:34 PM
Forumla to calculate a percentage julie regan Excel Discussion (Misc queries) 0 January 20th 05 07:53 PM
calculate percentage of two cells Suzie Excel Worksheet Functions 4 December 3rd 04 05:27 PM


All times are GMT +1. The time now is 10:32 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"