Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a macro to apply a formula to particular rows


Dear all,

I have a large dataset of meterological stations, each containing data
for an inconsistent duration of years in each case. Each year is on a
separate row and whilst most stations have data from 1950-1990, this
isn't always the case (i.e. some range from say, 1956-1972, 1982-1988,
1960-1978 etc etc... the years will always be continuous though - you
won't find, say, 1956-1970 [DATA GAP] 1975-1990 for any given station).
I'm interested in applying a linear projection to solar radiation values
(based on the year they are associated with), in order to estimate
future solar values in the year 2050.

Would you be able to design a means by which for each station (station
number is in column A), the highest solar value (in column F) between
1980-1990 (year is in column E) has the following formula applied to
it: ((2050-[year of highest solar value, e.g. 1988])*0.66)+[solar value
corresponding to the year chosen]. For example, ((2050-1988)*0.66)+123
which should yield an answer of 163.92. Solar values are also in column
Q (F = winter value whereas Q = summer value [for a particular year] -
these are on the same row as the year they are associated with); so
could you run the same process again, simply substituting the value in
column F for that in Q when applied to the "solar value corresponding
to the year chosen" term in the formula above.

With regard to where to place the output value, I figured that I'd
increase my spreadsheet efficiency by avoiding the creation of
additional columns. Instead, would you be able to place the newly
generated values (there should be two for each row in which the formula
has been applied), into a new *row* beneath the final row of existing
data for that particular station (e.g. the solar value for the formula
to be applied may have come from say, 1985, yet if the data for that
station continues until say, 1990, then the new row should be created
below the 1990 row and *not* the 1985 row. To complete the data for the
newly created row, could you enable all the data for the row in which
the highest solar value was selected to be copied and pasted down into
this new row, except of course for the cells in columns F and Q which
should contain the new solar values generated from the formula above,
and for the year column (E) which instead of containing the year value
for the row from which the data has been copied and pasted, should
always be '2050'.

So just to be clear, due to the data inconsistancies, not all stations
have data in the 1980-1990 range - these stations should be ignored and
no new values/rows generated for them. Some stations may have data for,
say, 1950-1983 - although the full 1980-1990 year range isn't available
in this case, the highest solar value for application of the formula
should still be chosen based on the greatest solar value between
1980-1983 in this case.

Sorry for the long-winded nature of this message, yet I hope the
clarity is there. If not, please do not hesitate to get back to me.

Many thanks for your help,
Steve


--
smurray444
------------------------------------------------------------------------
smurray444's Profile: http://www.excelforum.com/member.php...o&userid=28956
View this thread: http://www.excelforum.com/showthread...hreadid=508562

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Creating a macro to apply a formula to particular rows


Has anyone had any luck with this? I'd be very grateful for help here.

Thanks, Steve


--
smurray444
------------------------------------------------------------------------
smurray444's Profile: http://www.excelforum.com/member.php...o&userid=28956
View this thread: http://www.excelforum.com/showthread...hreadid=508562

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
Calculate number of rows and apply formula Grey Old Man[_2_] Excel Discussion (Misc queries) 4 March 15th 10 07:17 PM
How do I apply a formula to multiple rows at the same time? ManhattanRebel Excel Worksheet Functions 1 November 22nd 07 03:28 PM
setting a formula to apply to all rows in a column dave @ stejonda New Users to Excel 7 January 14th 07 09:09 AM
apply formula to other rows ... berti Excel Discussion (Misc queries) 1 December 15th 05 08:30 AM
Apply a simple formula to multiple rows? RedFox New Users to Excel 9 May 9th 05 11:42 PM


All times are GMT +1. The time now is 04:29 PM.

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

About Us

"It's about Microsoft Excel"