Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
The Shaffer s
 
Posts: n/a
Default SUMPRODUCT using offset from ROW if X marks the spot

I have a spreadsheet similar to the following:

Item, Total, 5, 13, 1, 127, 250
Lamps, formula, , X, , X,
Desks, formula, X, X, , ,
Tables, formula, , , X, , X

The formula results look on the Item row for corresponding X in the column
and add up the numbers:

Lamps, 140 ...
Desks, 18 ...
Tables, 251 ...

I managed to get a SUMPRODUCT formula to work using specific cell ranges.
What I can't get working, is the SUMPRODUCT formula using ROW()-xxx and
COLUMN()-yyy, so that the ranges are all relative. It's OK to know that the
Item row is 2 rows above the Desks row, for example.

With several spreadsheets in this format, I can then save as .csv files,
concatenate and reload as one into another spreadsheet and see in one sheet
the results of several.

Any help greatly appreciated.

Ken

  #2   Report Post  
MikeY
 
Posts: n/a
Default

B2: =SUMPRODUCT(C$1:G$1*(C2:G2="X"))

--
Mike

"The Shaffer s" wrote in message ...
  #3   Report Post  
The Shaffer s
 
Posts: n/a
Default

You used specific cell addresses, I wanted a formula which uses ROW() and
COLUMN().

On 11/1/04 10:41 PM, in article ,
"MikeY" wrote:

B2: =SUMPRODUCT(C$1:G$1*(C2:G2="X"))


  #4   Report Post  
Harlan Grove
 
Posts: n/a
Default

"The Shaffer s" wrote...
You used specific cell addresses, I wanted a formula which uses ROW() and
COLUMN().

"MikeY" wrote:
B2: =SUMPRODUCT(C$1:G$1*(C2:G2="X"))


If as you say in your original post that it's OK to know that the Items row
is 2 above the Desks row, then by implication the relative position of the
Items row is always know in relation to the other rows. If you understand
what this means and do mean it, then if the Items row were B3:H3, the
formulas would be

Lamps: =SUMIF(D4:H4,"X",D3:H3)
Desks: =SUMIF(D5:H5,"X",D3:H3)
Tables: =SUMIF(D6:H6,"X",D3:H3)

On the other hand, if you think that you need COLUMN or ROW or OFFSET, then
you either don't understand the problem or haven't stated all your specs. To
see this is so, rewrite the formulas above in R1C1 references.

Lamps: =SUMIF(RC[1]:RC[5],"X",R[-1]C[1]:R[-1]C[5])
Desks: =SUMIF(RC[1]:RC[5],"X",R[-2]C[1]:R[-2]C[5])
Tables: =SUMIF(RC[1]:RC[5],"X",R[-3]C[1]:R[-3]C[5])


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
OFFSET and array formulae Wazooli Excel Discussion (Misc queries) 3 January 20th 05 12:09 AM
Sumproduct ... Empty Cells vs Spaces? Ken Excel Discussion (Misc queries) 9 December 17th 04 08:03 PM
Offset? Patrick_KC Excel Discussion (Misc queries) 1 November 29th 04 10:17 PM


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