summing of columns - please help thanks

apwdweb

Board Regular
Joined
Aug 23, 2002
Messages
86
Hi,

Quick question...

i have two rows. F and H. F contains a series of random numbers. In cell H15 i will need to place the sum of the random numbers from F. However the tricky part is that the number of rows included in this sum is dictated by an integer variable I.

so for example

i = 5
means go to H15 will get the sum of F15 thru F20(count back i number of spaces).

Can some of the experts please help me figure out the other half of this equation to do this:

H15 = ?

Thank you.
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
You are hard to follow: You have random numbers in F2:F20 and you have some cel which houses 5 (your 'integer variable' i). In H15, you want to sum the random numbers Fx:F20 which houses 5 of them. Right?
 
Upvote 0
Hi Aladin Akyurek,

Close, what i'm looking to do is start at F15 and count up a variable (i) number of cells. so F15 - Fxx where Fxx minus F15 will equal i.

Please post if you need me to clarify more.

Thanks for your help in advance.
 
Upvote 0
apwdweb said:
...
Close, what i'm looking to do is start at F15 and count up a variable (i) number of cells. so F15 - Fxx where Fxx minus F15 will equal i...

Your question appears to be: Sum last i (where i=5) cells. What is the range of these random numbers? The last cell seems to be F15. What is the start cell of the range?
 
Upvote 0
I typed wrong let me try once again...

Active Cell = H15
H15 = Sum of F15 to Fxx (Fxx must be greater than F15 so i'm actually counting DOWN the rows. Sorry i mistyped earlier and put UPWARDS but anyhow it should be counting down rows)


the variable i have created as an integer, i, holds the number of cells i should count down.

So the sum could be:
F15 to F20 where I is 5
or
F15 to F32 where I is 17
of even
F15 to F1500 where I is 1485

thanks
 
Upvote 0
apwdweb said:
I typed wrong let me try once again...

Active Cell = H15
H15 = Sum of F15 to Fxx (Fxx must be greater than F15 so i'm actually counting DOWN the rows. Sorry i mistyped earlier and put UPWARDS but anyhow it should be counting down rows)


the variable i have created as an integer, i, holds the number of cells i should count down.

So the sum could be:
F15 to F20 where I is 5
or
F15 to F32 where I is 17
of even
F15 to F1500 where I is 1485

thanks

Why don't you just state what the current range is?
 
Upvote 0
Hi,

Please bear with me as I'm rather new to VB. i've tried making the correct syntax but have been rather unsuccessful.

Can you please teach me what the code would look like using the variables I stated above?

Thanks
 
Upvote 0
apwdweb said:
Hi,

Please bear with me as I'm rather new to VB. i've tried making the correct syntax but have been rather unsuccessful.

Can you please teach me what the code would look like using the variables I stated above?

Thanks

I thought you would accept a formula solution. I should have known better with that "integer variable I". You want VBA, so this will be for someone else. However, I'm amazed I couldn't get your current range.
 
Upvote 0
Thanks for your help anyway. If anyone out there knows how to do this in VB Please do reply an answer as i could really use the help.

Thanks
 
Upvote 0

Forum statistics

Threads
1,222,437
Messages
6,166,027
Members
452,008
Latest member
Customlogoflipflops

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top