Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
pimar
 
Posts: n/a
Default sum on conditions.....


Hello again,
I have a new question for you, guru.

This is my worksheet

Column A Column B

Member A 5
f
Member B 5
m
Member C 5
f

As you can see, for each "member" I need to specify 2 values : a
numeric one (let's say "age") and string one ("f"="female" or
"m"="man").

My problem is to sum the ages for all "female" (f) members .... and sum
of ages for "man" (m) members.

Of course, it would be simplier to have

Member A 5 f
Member B 5 i
Member C 5 f

but I cannot change the spreadsheet as it is now.

How can achieve this result?

thanks a lot
*pimar


--
pimar
------------------------------------------------------------------------
pimar's Profile: http://www.excelforum.com/member.php...fo&userid=5386
View this thread: http://www.excelforum.com/showthread...hreadid=374137

  #2   Report Post  
tkaplan
 
Posts: n/a
Default


one possible solution(although not very elegant)...
in c1:
=IF(A2="f",B1,0)

d1:
=IF(A2="m",B1,0)

put this formula in every other line. then you can sum col c for your
f's and d for your m's


--
tkaplan
------------------------------------------------------------------------
tkaplan's Profile: http://www.excelforum.com/member.php...o&userid=22987
View this thread: http://www.excelforum.com/showthread...hreadid=374137

  #3   Report Post  
pimar
 
Posts: n/a
Default


Thank you,
but I really cannot use this solution, mainly because I should repeat
this operation for dozen of coloumns (it means I shlould have at ņeast
2*12 new columns ... it would make my excel unusable)...
btw, thanks for your reply...
*pimar


--
pimar
------------------------------------------------------------------------
pimar's Profile: http://www.excelforum.com/member.php...fo&userid=5386
View this thread: http://www.excelforum.com/showthread...hreadid=374137

  #4   Report Post  
greg7468
 
Posts: n/a
Default


Hi,
again not a very elegant way but may possibly work,

I assume your spreadsheet looks like this

---col A-------col B
--name-------age
-gender-----blank

If so could you not copy B1 (age) into B2

Then have a subtotal for each column.

Filter to the gender required and the subtotal should sum the ages

----col A------col B
-----f------------5
-----f------------6
-----f------------5

---total---------11


HTH,

Greg.


--
greg7468
------------------------------------------------------------------------
greg7468's Profile: http://www.excelforum.com/member.php...fo&userid=9031
View this thread: http://www.excelforum.com/showthread...hreadid=374137

  #5   Report Post  
mangesh_yadav
 
Posts: n/a
Default


I copied your example in the range A1:B6. Now to get the age of all
females, use the following formula:
=SUMPRODUCT(B1:B6,--(OFFSET(A1:A6,1,0)="f"))

and for males, use:
=SUMPRODUCT(B1:B6,--(OFFSET(A1:A6,1,0)="m"))


Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=374137



  #6   Report Post  
pimar
 
Posts: n/a
Default


Thanks a lot all of you.
I've adopted the solution proposed by Mangesh . It was exactly what I
was looking for... :)

ciao
*pimar


--
pimar
------------------------------------------------------------------------
pimar's Profile: http://www.excelforum.com/member.php...fo&userid=5386
View this thread: http://www.excelforum.com/showthread...hreadid=374137

  #7   Report Post  
mangesh_yadav
 
Posts: n/a
Default


Good it helped you. Thanks for the feedback.

Mangesh


--
mangesh_yadav
------------------------------------------------------------------------
mangesh_yadav's Profile: http://www.excelforum.com/member.php...o&userid=10470
View this thread: http://www.excelforum.com/showthread...hreadid=374137

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
Counting occurrences of multiple conditions Jvanderv1 Excel Discussion (Misc queries) 2 April 6th 05 01:07 AM
How do I count number of cels the matches 2 conditions ? Abra Excel Worksheet Functions 2 February 27th 05 08:56 PM
should be possible to add more conditions to conditional formatti. excel_jan Excel Discussion (Misc queries) 3 February 9th 05 06:41 PM
How to multiple conditions to validate more than 2 conditions to . Bhuvana Govind Excel Worksheet Functions 1 January 28th 05 07:07 PM
average on 2 conditions Ted Metro Excel Worksheet Functions 6 January 7th 05 08:23 PM


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