Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Tat
 
Posts: n/a
Default sumproduct in a range

I have 27 columns. The first column refers to a calendar year ie 2003, 2004.
There are multilple occurences of the same year in this column. The rest of
the columns may or may not have numbers in the cells.

I would like to count the cells that do have numbers that correspond to the
year selected.

I'm not too sure how to use the sumproduct function but this is the formula
I created and doesn't work:
=SUMPRODUCT(--(A12:A24=W34),--(B12:BA240))

W34 indicates the year I would like the used cells counted.
Assistance is mighty appreciated.
  #2   Report Post  
Peo Sjoblom
 
Posts: n/a
Default

One way

=SUMPRODUCT((A12:A24=W34)*(B12:BA240))

using excel built in method of (--(range=x),--(range=y)

will not work if the ranges have different sizes

--
Regards,

Peo Sjoblom

(No private emails please)


"Tat" wrote in message
...
I have 27 columns. The first column refers to a calendar year ie 2003,
2004.
There are multilple occurences of the same year in this column. The rest
of
the columns may or may not have numbers in the cells.

I would like to count the cells that do have numbers that correspond to
the
year selected.

I'm not too sure how to use the sumproduct function but this is the
formula
I created and doesn't work:
=SUMPRODUCT(--(A12:A24=W34),--(B12:BA240))

W34 indicates the year I would like the used cells counted.
Assistance is mighty appreciated.


  #4   Report Post  
Arvi Laanemets
 
Posts: n/a
Default

Hi

=SUM(IF($A$12:$A$24=W34,$B$12:$BA$24,0))
entered as an array formula (Ctrl+Shift+Enter)


Arvi Laanemets


"Tat" wrote in message
...
I have 27 columns. The first column refers to a calendar year ie 2003,

2004.
There are multilple occurences of the same year in this column. The rest

of
the columns may or may not have numbers in the cells.

I would like to count the cells that do have numbers that correspond to

the
year selected.

I'm not too sure how to use the sumproduct function but this is the

formula
I created and doesn't work:
=SUMPRODUCT(--(A12:A24=W34),--(B12:BA240))

W34 indicates the year I would like the used cells counted.
Assistance is mighty appreciated.



  #5   Report Post  
Aladin Akyurek
 
Posts: n/a
Default

Tat wrote:
I have 27 columns. The first column refers to a calendar year ie 2003, 2004.
There are multilple occurences of the same year in this column. The rest of
the columns may or may not have numbers in the cells.

I would like to count the cells that do have numbers that correspond to the
year selected.

I'm not too sure how to use the sumproduct function but this is the formula
I created and doesn't work:
=SUMPRODUCT(--(A12:A24=W34),--(B12:BA240))

W34 indicates the year I would like the used cells counted.
Assistance is mighty appreciated.


You have to switch to the comma syntax to the "star" syntax:

=SUMPRODUCT((A12:A24=W34)*(B12:BA240))

if B12:BA24 does not house any text values.

Otherwise, one of:

=SUM(IF(A12:A24=W34,IF(B12:BA240,1,0)))

=SUM(IF(A12:A24=W34,IF(ISNUMBER(B12:BA24)*(B12:BA2 40),1,0)))

which must be confirmed with control+shift+enter instead of just enter.

--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.


  #7   Report Post  
Tat
 
Posts: n/a
Default

Tried it but didn't work.
Used =Sum(IF(a12:a24=w34,if(b12:ba240,1,0))) that A.Akyurek suggested with
cntrl +shift+enter. That worked.

Thanks for your efforts.

"Peo Sjoblom" wrote:

One way

=SUMPRODUCT((A12:A24=W34)*(B12:BA240))

using excel built in method of (--(range=x),--(range=y)

will not work if the ranges have different sizes

--
Regards,

Peo Sjoblom

(No private emails please)


"Tat" wrote in message
...
I have 27 columns. The first column refers to a calendar year ie 2003,
2004.
There are multilple occurences of the same year in this column. The rest
of
the columns may or may not have numbers in the cells.

I would like to count the cells that do have numbers that correspond to
the
year selected.

I'm not too sure how to use the sumproduct function but this is the
formula
I created and doesn't work:
=SUMPRODUCT(--(A12:A24=W34),--(B12:BA240))

W34 indicates the year I would like the used cells counted.
Assistance is mighty appreciated.



  #8   Report Post  
Tat
 
Posts: n/a
Default

Thank you. That works great!

"Arvi Laanemets" wrote:

Hi

=SUM(IF($A$12:$A$24=W34,$B$12:$BA$24,0))
entered as an array formula (Ctrl+Shift+Enter)


Arvi Laanemets


"Tat" wrote in message
...
I have 27 columns. The first column refers to a calendar year ie 2003,

2004.
There are multilple occurences of the same year in this column. The rest

of
the columns may or may not have numbers in the cells.

I would like to count the cells that do have numbers that correspond to

the
year selected.

I'm not too sure how to use the sumproduct function but this is the

formula
I created and doesn't work:
=SUMPRODUCT(--(A12:A24=W34),--(B12:BA240))

W34 indicates the year I would like the used cells counted.
Assistance is mighty appreciated.




  #9   Report Post  
Tat
 
Posts: n/a
Default

Thanks for your suggestion with conditional sum if. That worked. (sumproduct
did not).

Have a good one!

"Aladin Akyurek" wrote:

Tat wrote:
I have 27 columns. The first column refers to a calendar year ie 2003, 2004.
There are multilple occurences of the same year in this column. The rest of
the columns may or may not have numbers in the cells.

I would like to count the cells that do have numbers that correspond to the
year selected.

I'm not too sure how to use the sumproduct function but this is the formula
I created and doesn't work:
=SUMPRODUCT(--(A12:A24=W34),--(B12:BA240))

W34 indicates the year I would like the used cells counted.
Assistance is mighty appreciated.


You have to switch to the comma syntax to the "star" syntax:

=SUMPRODUCT((A12:A24=W34)*(B12:BA240))

if B12:BA24 does not house any text values.

Otherwise, one of:

=SUM(IF(A12:A24=W34,IF(B12:BA240,1,0)))

=SUM(IF(A12:A24=W34,IF(ISNUMBER(B12:BA24)*(B12:BA2 40),1,0)))

which must be confirmed with control+shift+enter instead of just enter.

--

[1] The SumProduct function should implicitly coerce the truth values to
their Excel numeric equivalents.
[2] The lookup functions should have an optional argument for the return
value, defaulting to #N/A in its absence.

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
Changing a range of an array in a SUMPRODUCT formula gives a #N/A error Chrism Excel Discussion (Misc queries) 4 May 4th 05 04:06 PM
sumproduct of part cells of a range with blanks excelFan Excel Discussion (Misc queries) 4 February 25th 05 10:37 PM
Indirect range in SUMPRODUCT? BobT Excel Discussion (Misc queries) 2 February 16th 05 08:51 PM
SUMPRODUCT with date range question Rob V Excel Discussion (Misc queries) 1 January 31st 05 03:55 PM
using sumproduct in a range of text fields? Basil Excel Worksheet Functions 1 December 13th 04 12:19 PM


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