Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Vlad
 
Posts: n/a
Default Conditional Range w/Sum

Ok..I've been trying to bang out a formula that will essentially do a sum on
a variable range within a certain column--Column A. The range will be
determined by a value in another column--Column B. Example: If the value in
cell B1 is between 1-2, the formula sums cells A1 and A2 and returns the
value to, say, cell C2. Any advice on how to set up this kind of variable
range (for lack of a better term) within a formula would be greatly
appreciated.
  #2   Report Post  
JE McGimpsey
 
Posts: n/a
Default

One way:

C2 =IF(AND(B11,B1<2),SUM(A1:A2),"")

In article ,
"Vlad" wrote:

Ok..I've been trying to bang out a formula that will essentially do a sum on
a variable range within a certain column--Column A. The range will be
determined by a value in another column--Column B. Example: If the value in
cell B1 is between 1-2, the formula sums cells A1 and A2 and returns the
value to, say, cell C2. Any advice on how to set up this kind of variable
range (for lack of a better term) within a formula would be greatly
appreciated.

  #3   Report Post  
PC
 
Posts: n/a
Default

Look at the OFFSET function

Something like

=SUM(OFFSET(A1,0,0,ROUNDUP(B1)))

Maybe

PC

"Vlad" wrote in message
...
Ok..I've been trying to bang out a formula that will essentially do a sum

on
a variable range within a certain column--Column A. The range will be
determined by a value in another column--Column B. Example: If the value

in
cell B1 is between 1-2, the formula sums cells A1 and A2 and returns the
value to, say, cell C2. Any advice on how to set up this kind of variable
range (for lack of a better term) within a formula would be greatly
appreciated.



  #4   Report Post  
Bernie Deitrick
 
Posts: n/a
Default

In C2, you could use the formula:

=SUM(INDIRECT("A1:A" & B1))

So if B1 were 3, you would get the sum from A1:A3.

HTH,
Bernie
MS Excel MVP


"Vlad" wrote in message
...
Ok..I've been trying to bang out a formula that will essentially do a sum

on
a variable range within a certain column--Column A. The range will be
determined by a value in another column--Column B. Example: If the value

in
cell B1 is between 1-2, the formula sums cells A1 and A2 and returns the
value to, say, cell C2. Any advice on how to set up this kind of variable
range (for lack of a better term) within a formula would be greatly
appreciated.



  #5   Report Post  
RagDyer
 
Posts: n/a
Default

Another way:

=SUM(A1:INDEX(A:A,B1))
--
Regards,

RD

---------------------------------------------------------------------------
Please keep all correspondence within the NewsGroup, so all may benefit !
---------------------------------------------------------------------------


"Bernie Deitrick" <deitbe @ consumer dot org wrote in message
...
In C2, you could use the formula:

=SUM(INDIRECT("A1:A" & B1))

So if B1 were 3, you would get the sum from A1:A3.

HTH,
Bernie
MS Excel MVP


"Vlad" wrote in message
...
Ok..I've been trying to bang out a formula that will essentially do a

sum
on
a variable range within a certain column--Column A. The range will be
determined by a value in another column--Column B. Example: If the value

in
cell B1 is between 1-2, the formula sums cells A1 and A2 and returns the
value to, say, cell C2. Any advice on how to set up this kind of

variable
range (for lack of a better term) within a formula would be greatly
appreciated.




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
Define a range based on another named range Basil Excel Worksheet Functions 2 February 21st 05 01:47 PM
Conditional data validation (using a filtered range?) Simon Excel Worksheet Functions 0 February 15th 05 02:39 PM
How do I set a date range for conditional formatting in a macro? billo Excel Worksheet Functions 3 February 7th 05 06:19 PM
Conditional formatting not available in Excel BAB Excel Discussion (Misc queries) 2 January 1st 05 03:33 PM
HOW TO USE CONDITIONAL FORMATTING FROM ONE RANGE TO ANOTHER RANGE PeggyP Excel Worksheet Functions 2 November 4th 04 07:29 PM


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