A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sum values in one row dependent on a value in a different row



 
 
Thread Tools Display Modes
  #1  
Old September 1st, 2008, 06:27 PM posted to microsoft.public.excel.worksheet.functions
Mike of Tilford
external usenet poster
 
Posts: 1
Default Sum values in one row dependent on a value in a different row

In Row 5 I have 9 cells with the text value of S, W or R, 3 of each - ie S,
R, S, W, W, S, R, R, W. This is a random order that changes in each table.

In Row 9 there is a different numerical value in each Cell. I want to sum
the cell values in Row 9 that correspond to the 3 columns that have the S,
the R and the W in them.

I started using an IF fn thus: IF(B5:J5 "(S)", and the test
gives me the correct string (True, False, True, True etc) but then I got
stuck. I don't think this is the correct function to use, so...

How do I get one cell to see what text value (S or R or W) is in Row 5, and
sum the 3 resulting cells in Row 9 that correspond to the text value in the
same column in Row 5?

I think I have over-complicated my question so can clarify if any confusion.

Many thanks,

Mike
  #2  
Old September 1st, 2008, 06:41 PM posted to microsoft.public.excel.worksheet.functions
RagDyeR
external usenet poster
 
Posts: 3,482
Default Sum values in one row dependent on a value in a different row

Try this:

=Sumif(B5:J5,"S",B9:J9)

You could assign a cell to contain your criteria, so that changing the
contents of the cell would total the different letters.

Say you used B1 for your variable:

=Sumif(B5:J5,B1,B9:J9)

--
HTH,

RD

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

"Mike of Tilford" Mike of wrote in
message ...
In Row 5 I have 9 cells with the text value of S, W or R, 3 of each - ie

S,
R, S, W, W, S, R, R, W. This is a random order that changes in each

table.

In Row 9 there is a different numerical value in each Cell. I want to sum
the cell values in Row 9 that correspond to the 3 columns that have the S,
the R and the W in them.

I started using an IF fn thus: IF(B5:J5 "(S)", and the

test
gives me the correct string (True, False, True, True etc) but then I got
stuck. I don't think this is the correct function to use, so...

How do I get one cell to see what text value (S or R or W) is in Row 5,

and
sum the 3 resulting cells in Row 9 that correspond to the text value in

the
same column in Row 5?

I think I have over-complicated my question so can clarify if any

confusion.

Many thanks,

Mike


  #3  
Old September 1st, 2008, 06:46 PM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default Sum values in one row dependent on a value in a different row

Try

=SUMPRODUCT((B5:J5="S")*(B9:J9))

And substitute S with W & R

Mike

"Mike of Tilford" wrote:

In Row 5 I have 9 cells with the text value of S, W or R, 3 of each - ie S,
R, S, W, W, S, R, R, W. This is a random order that changes in each table.

In Row 9 there is a different numerical value in each Cell. I want to sum
the cell values in Row 9 that correspond to the 3 columns that have the S,
the R and the W in them.

I started using an IF fn thus: IF(B5:J5 "(S)", and the test
gives me the correct string (True, False, True, True etc) but then I got
stuck. I don't think this is the correct function to use, so...

How do I get one cell to see what text value (S or R or W) is in Row 5, and
sum the 3 resulting cells in Row 9 that correspond to the text value in the
same column in Row 5?

I think I have over-complicated my question so can clarify if any confusion.

Many thanks,

Mike

  #4  
Old September 1st, 2008, 07:08 PM posted to microsoft.public.excel.worksheet.functions
Mike of Tilford[_2_]
external usenet poster
 
Posts: 2
Default Sum values in one row dependent on a value in a different row

Brilliant - Thanks. Both suggestions work.

"Mike H" wrote:

Try

=SUMPRODUCT((B5:J5="S")*(B9:J9))

And substitute S with W & R

Mike

"Mike of Tilford" wrote:

In Row 5 I have 9 cells with the text value of S, W or R, 3 of each - ie S,
R, S, W, W, S, R, R, W. This is a random order that changes in each table.

In Row 9 there is a different numerical value in each Cell. I want to sum
the cell values in Row 9 that correspond to the 3 columns that have the S,
the R and the W in them.

I started using an IF fn thus: IF(B5:J5 "(S)", and the test
gives me the correct string (True, False, True, True etc) but then I got
stuck. I don't think this is the correct function to use, so...

How do I get one cell to see what text value (S or R or W) is in Row 5, and
sum the 3 resulting cells in Row 9 that correspond to the text value in the
same column in Row 5?

I think I have over-complicated my question so can clarify if any confusion.

Many thanks,

Mike

  #5  
Old September 1st, 2008, 07:09 PM posted to microsoft.public.excel.worksheet.functions
Mike of Tilford[_2_]
external usenet poster
 
Posts: 2
Default Sum values in one row dependent on a value in a different row

Brilliant - Thanks. Both posts work.

"Ragdyer" wrote:

Try this:

=Sumif(B5:J5,"S",B9:J9)

You could assign a cell to contain your criteria, so that changing the
contents of the cell would total the different letters.

Say you used B1 for your variable:

=Sumif(B5:J5,B1,B9:J9)

--
HTH,

RD

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

"Mike of Tilford" Mike of wrote in
message ...
In Row 5 I have 9 cells with the text value of S, W or R, 3 of each - ie

S,
R, S, W, W, S, R, R, W. This is a random order that changes in each

table.

In Row 9 there is a different numerical value in each Cell. I want to sum
the cell values in Row 9 that correspond to the 3 columns that have the S,
the R and the W in them.

I started using an IF fn thus: IF(B5:J5 "(S)", and the

test
gives me the correct string (True, False, True, True etc) but then I got
stuck. I don't think this is the correct function to use, so...

How do I get one cell to see what text value (S or R or W) is in Row 5,

and
sum the 3 resulting cells in Row 9 that correspond to the text value in

the
same column in Row 5?

I think I have over-complicated my question so can clarify if any

confusion.

Many thanks,

Mike



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 09:58 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.