Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default probably an easy question for you but I'm stuck

And I can't find a good start Site

The problem is the following. I have an range in excell. For every cell
I have to calculate the sum of the previous 30 cells in fe row A.(so
far a piece of cake) Next to those cells there can be a letter fe V. If
there is such a letter you have to add it with the amount of V's that
I've found. that result has to be placed in row C.

So if in the range of 30cells there are 5 cells with v, he has to make
the sum of 35 cells. And if in the consecutive 5 cells is a V, they
have to be added aswell.

I've made the formula with my own syntax but I don't know how to start
making it work in vba. Here it is:

Count1 V in (currentcell(row-1)(column-1)):
(currentcell(row-1)(column-30))
result result1

Count2 V in (currentcell(row-1)(column-1) :
(currentcell(row-1)(column-30-result1))
result result2

if result1=result2
goto count3
else copy result2 to result1
goto count2

Count3
Sum(currentcell(row-1)(column-1)):(currentcell(row-1)(column-30-result2))
put result in currentcell

Anybody a hint for me?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default probably an easy question for you but I'm stuck


Put this in the start cell in column C (where you want the sum for A1:A30 +)


=SUM(OFFSET(A1,0,0,30,1))+SUM(OFFSET(A1,30,0,COUNT IF(B1:B30,"V"),1))*(COUNTIF(OFFSET(B1,30,0,COUNTIF (B1:B30,"V"),1),"V")0)

then drag fill down the column.

--
Regards,
Tom Ogilvy




wrote in message
ups.com...
And I can't find a good start Site

The problem is the following. I have an range in excell. For every cell
I have to calculate the sum of the previous 30 cells in fe row A.(so
far a piece of cake) Next to those cells there can be a letter fe V. If
there is such a letter you have to add it with the amount of V's that
I've found. that result has to be placed in row C.

So if in the range of 30cells there are 5 cells with v, he has to make
the sum of 35 cells. And if in the consecutive 5 cells is a V, they
have to be added aswell.

I've made the formula with my own syntax but I don't know how to start
making it work in vba. Here it is:

Count1 V in (currentcell(row-1)(column-1)):
(currentcell(row-1)(column-30))
result result1

Count2 V in (currentcell(row-1)(column-1) :
(currentcell(row-1)(column-30-result1))
result result2

if result1=result2
goto count3
else copy result2 to result1
goto count2

Count3
Sum(currentcell(row-1)(column-1)):(currentcell(row-1)(column-30-result2))
put result in currentcell

Anybody a hint for me?



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
An easy answer I'm sure, so why am I stuck? Dan the Man[_2_] Excel Discussion (Misc queries) 5 September 21st 08 05:25 PM
Dynamic chart -easy question that has me stuck glenlee Excel Discussion (Misc queries) 5 September 10th 07 01:29 AM
Easy VBA question Dallman Ross Excel Discussion (Misc queries) 2 August 6th 07 01:26 AM
new user with easy question? not easy for me speakeztruth New Users to Excel 5 June 3rd 05 09:40 PM
Easy Question Lawson Excel Programming 1 October 20th 03 09:28 PM


All times are GMT +1. The time now is 01:44 AM.

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"