Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Junior Member
 
Posts: 1
Default Trying to summarize same values

Hey,

I have this, for example:

Column A:
X
Y
Z
X

Column B:
1
2
3
4

I want to be able to summarize all values in Column B which Column A=X or Column A=Y. The result should be 7 (1+2+4).

I did this:

SUM(IF(COUNTIF(A:A,"X"),VLOOOKUP("X",A:B,2,),"0"), IF(COUNTIF(A:A,"Y"),VLOOOKUP("Y",A:B,2,),"0"))

For some reason, it returns 3. It doesn't adds the second value of X for some reason.

Any ideas why?

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 536
Default Trying to summarize same values

On Wednesday, November 14, 2012 4:24:51 PM UTC-8, riktubrs wrote:
Hey,



I have this, for example:



Column A:

X

Y

Z

X



Column B:

1

2

3

4



I want to be able to summarize all values in Column B which Column A=X

or Column A=Y. The result should be 7 (1+2+4).



I did this:



SUM(IF(COUNTIF(A:A,"X"),VLOOOKUP("X",A:B,2,),"0"), IF(COUNTIF(A:A,"Y"),VLOOOKUP("Y",A:B,2,),"0"))



For some reason, it returns 3. It doesn't adds the second value of X for

some reason.



Any ideas why?



Thanks!









--

riktubrs


Hi riktubrs,

Try this:

=SUMIF(A1:A4,"X",B1:B4)+SUMIF(A1:A4,"Y",B1:B4)

HTH
Regards,
Howard
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
Cant summarize nrs like 15.200,00 Sircantona Excel Discussion (Misc queries) 3 April 29th 08 05:59 PM
summarize PBark New Users to Excel 3 April 11th 06 04:59 PM
summarize Bruno Excel Programming 2 September 7th 05 12:53 PM
How do I summarize totals for a list of values in Excel? KelleyS Excel Worksheet Functions 2 April 13th 05 09:56 PM
VBA summarize Dorian T Excel Programming 2 October 2nd 03 11:42 PM


All times are GMT +1. The time now is 04:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"