Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Bruce Norris
 
Posts: n/a
Default sumif involving another column

I'm stuck again. This time I need a formula to add column D by grouped
values in column A.

I don't know how to word my quandry, so I'll give an example...

The answer, using data below, is 400, because the cost for each trip number
is added only once even though it appears many times.

A B C D
Trip Covered Visited Cost
tr-24 Yes Factory 100
tr-24 Yes Office 100
tr-24 Yes Warehouse 100
tr-50 Office
tr-50 Factory
tr-16 Yes HQ 300
tr-16 Yes Office 300
tr-16 Yes Plant 300
tr-16 Yes Warehouse 300

Would this be another sumproduct array formula. I tried, but kept getting
the wrong answer. Could someone help me again. I thank you.

Excel 2000


  #2   Report Post  
Bruce Norris
 
Posts: n/a
Default

I think I may have gotten it.

=SUMPRODUCT((a2:a10=a2:a10)*d2:d10)

The answer is correct. Does it look right to you?

Thanks.

"Bruce Norris" wrote in message
. ..
I'm stuck again. This time I need a formula to add column D by grouped
values in column A.

I don't know how to word my quandry, so I'll give an example...

The answer, using data below, is 400, because the cost for each trip
number is added only once even though it appears many times.

A B C D
Trip Covered Visited Cost
tr-24 Yes Factory 100
tr-24 Yes Office 100
tr-24 Yes Warehouse 100
tr-50 Office
tr-50 Factory
tr-16 Yes HQ 300
tr-16 Yes Office 300
tr-16 Yes Plant 300
tr-16 Yes Warehouse 300

Would this be another sumproduct array formula. I tried, but kept getting
the wrong answer. Could someone help me again. I thank you.

Excel 2000



  #3   Report Post  
Ron Coderre
 
Posts: n/a
Default

If your data table starts in A1 and the data begins in row 2:

Try putting this formula in Cell E1:
=SUM(1/COUNTIF($A$2:$A$10,$A$2:$A$10)*$D$2:$D$10)

(Note: Commit that array formula by pressing [Ctrl]+[Shifr]+[Enter]

Regards,
Ron

  #4   Report Post  
Bruce Norris
 
Posts: n/a
Default

No, I was wrong. The answer is incorrect. So, I still don't have the right
formula.


"Bruce Norris" wrote in message
.. .
I think I may have gotten it.

=SUMPRODUCT((a2:a10=a2:a10)*d2:d10)

The answer is correct. Does it look right to you?

Thanks.

"Bruce Norris" wrote in message
. ..
I'm stuck again. This time I need a formula to add column D by grouped
values in column A.

I don't know how to word my quandry, so I'll give an example...

The answer, using data below, is 400, because the cost for each trip
number is added only once even though it appears many times.

A B C D
Trip Covered Visited Cost
tr-24 Yes Factory 100
tr-24 Yes Office 100
tr-24 Yes Warehouse 100
tr-50 Office
tr-50 Factory
tr-16 Yes HQ 300
tr-16 Yes Office 300
tr-16 Yes Plant 300
tr-16 Yes Warehouse 300

Would this be another sumproduct array formula. I tried, but kept getting
the wrong answer. Could someone help me again. I thank you.

Excel 2000





  #5   Report Post  
Bruce Norris
 
Posts: n/a
Default

That's it! Thanks, Ron!!


"Ron Coderre" wrote in message
...
If your data table starts in A1 and the data begins in row 2:

Try putting this formula in Cell E1:
=SUM(1/COUNTIF($A$2:$A$10,$A$2:$A$10)*$D$2:$D$10)

(Note: Commit that array formula by pressing [Ctrl]+[Shifr]+[Enter]

Regards,
Ron



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
How do I sort by row instead of by column? PercivalMound Excel Worksheet Functions 7 August 28th 06 10:41 PM
How to countif involving another column? Bruce Norris Excel Worksheet Functions 11 April 5th 05 07:00 AM
How do I reference every "n" cell in a column in Excel? Alma Excel Worksheet Functions 2 March 22nd 05 06:19 PM
Copying the contents of a column into a chart Richard Excel Worksheet Functions 1 November 16th 04 02:39 PM
How Do I created a nested sumif - if this column has this and thi. Gita Mooney Excel Worksheet Functions 5 November 1st 04 04:18 PM


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