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

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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?
 

apwdweb

Board Regular
Joined
Aug 23, 2002
Messages
86
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.
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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?
 

apwdweb

Board Regular
Joined
Aug 23, 2002
Messages
86

ADVERTISEMENT

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
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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?
 

apwdweb

Board Regular
Joined
Aug 23, 2002
Messages
86

ADVERTISEMENT

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
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,209
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.
 

apwdweb

Board Regular
Joined
Aug 23, 2002
Messages
86
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
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,164
Messages
5,768,564
Members
425,482
Latest member
blazingdiva1

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
Top