#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 38
Default conditional sum?

A1= Apple B1 =12
A2= Orange B2 = 52
A3 = Orange B3= 51
A4=Banana B4=53
A5 =grape B5=43
A6=grape B6 = 6
A7=grape B7 = 88



In the C column I'd like to add the number from B column if A column the
same.

The end result will look like:

C1= 12
C2 = 52+ 51 (as A2 and A3 both are orange so add B2 and B3
together)
C3= "" (leave it blank as C2 already did the job)
C4=53
C5 = 43+6 +88 (as A5, A6 and A7 are all grape, so add B5 to B7
together)
C6 = ""
C7 =""


so the outcome will look like this:

A1= Apple B1 =12 C1=12
A2= Orange B2 = 52 C2=103
A3 = Orange B3= 51 C3=
A4=Banana B4=53 C4=53
A5 =grape B5=43 C5=137
A6=grape B6 = 6 C6=
A7=grape B7 = 88 C7=


Any suggesion?

Thanks





  #3   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default conditional sum?

One way
In C1: =IF(A1="","",SUMIF(A:A,A1,B:B))
In D1: =IF(COUNTIF($A$1:A1,A1)1,"",C1)
Select C1:D1, copy down. Hide away col C.
Col D returns the required results.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Lamb Chop" wrote in message
...
A1= Apple B1 =12
A2= Orange B2 = 52
A3 = Orange B3= 51
A4=Banana B4=53
A5 =grape B5=43
A6=grape B6 = 6
A7=grape B7 = 88



In the C column I'd like to add the number from B column if A column the
same.

The end result will look like:

C1= 12
C2 = 52+ 51 (as A2 and A3 both are orange so add B2 and B3
together)
C3= "" (leave it blank as C2 already did the
job)
C4=53
C5 = 43+6 +88 (as A5, A6 and A7 are all grape, so add B5 to B7
together)
C6 = ""
C7 =""


so the outcome will look like this:

A1= Apple B1 =12 C1=12
A2= Orange B2 = 52 C2=103
A3 = Orange B3= 51 C3=
A4=Banana B4=53 C4=53
A5 =grape B5=43 C5=137
A6=grape B6 = 6 C6=
A7=grape B7 = 88 C7=


Any suggesion?

Thanks







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
Conditional SUM Q Sean Excel Worksheet Functions 7 October 30th 07 10:04 PM
Conditional Rank (or rather, Conditional Range) [email protected] Excel Worksheet Functions 6 April 16th 07 06:15 PM
Conditional Formatting that will display conditional data BrainFart Excel Worksheet Functions 1 September 13th 05 05:45 PM
Conditional Sum RK Excel Worksheet Functions 3 December 17th 04 10:43 AM
Conditional Sum Gos-C Excel Worksheet Functions 1 October 27th 04 11:20 PM


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