Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
DRK DRK is offline
external usenet poster
 
Posts: 40
Default Getting number of value changes in column with count of each durat

I have 42 columns each starting in Row 2 ending in Row 121.

I need to walk through each column and find each change in value and how
many rows between changes. Each row is a year.

For example, I have a column with these values
Row1 - Column name (so not part of the loop)
Rows 2:6 - value is 5.00 in each cell
Rows 7:11 - value is 2.50 in each cell
Rows 12:121 - value is 0.00 in each cell

What I need to produce in the end is a listing of each value and how many
rows for each value. So I'd end up with a listing like:
Value = 5.00 for 5 years
Value = 2.50 for 5 years
Value = 0.0 for 110 years

Some columns may change every year. Yes - the lawyers tell me I'd have to
list each year one by one.

One one hand this could be a For/Next loop since we know the number of rows
to examine. But then would a Do Until work better? Or use a Do Until inside
the For/Next?

Ideally I want a sub or function that can be used for all the columns. I can
pass the current column number in by argument.

Values can be doubles or integers or blanks. So I'm assuming I would use
Variant as the value type.

--
DRK
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 count the number of each number in a column? Shelby Excel Discussion (Misc queries) 6 September 27th 08 08:48 PM
Count number of cells and total in one column, based on another column suffix Pierre Excel Worksheet Functions 5 October 31st 07 12:28 AM
How do I count the frequency of a given number in a column? dykstra_sj New Users to Excel 6 February 2nd 06 08:32 PM
Count number of items in one column that have a value in another? onthefritz Excel Worksheet Functions 5 December 10th 05 04:19 PM
How can I count the number of entries in a column? Dave Hacker New Users to Excel 3 November 24th 05 08:48 PM


All times are GMT +1. The time now is 10:03 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"