Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Multiple Coumns Criteria

I currently use the sumif and countif functions to create some control
values in my VBA code when processing the worksheets. All works fine.

However I now wish to modify the use of each of these functions by testing
the criteria for more than one column.

Currently I have something like.... SumIf(A1:A100,"=A",C1:C100), I now need
to test for two columns

Something like..... SumIf(A1:A100,"=A" and B1:B100,"="B", C1:C100),
obviously this does not work in this form. What do I need to do?

I would rather not create helper columns as I have many combinations of
values to sum across......do I need to write it in code or some sort of
array formula?

Many thanks


--
Cheers
Nigel




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Multiple Coumns Criteria

Hi Nigel,

Try something like:

=SUMPRODUCT((A1:A100="A")*(B1:B100="B"))

and

=SUMPRODUCT((A1:A100="A")*(B1:B100="B")*(C1:C100))

---
Regards,
Norman


"Nigel" wrote in message
...
I currently use the sumif and countif functions to create some control
values in my VBA code when processing the worksheets. All works fine.

However I now wish to modify the use of each of these functions by testing
the criteria for more than one column.

Currently I have something like.... SumIf(A1:A100,"=A",C1:C100), I now
need to test for two columns

Something like..... SumIf(A1:A100,"=A" and B1:B100,"="B", C1:C100),
obviously this does not work in this form. What do I need to do?

I would rather not create helper columns as I have many combinations of
values to sum across......do I need to write it in code or some sort of
array formula?

Many thanks


--
Cheers
Nigel






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Multiple Coumns Criteria

How about the Sum of two SumIfs?

Sum(SumIf(A1:A100,"=A",C1:C100), SumIf(B1:B100,"=B",C1:C100))

Mike F
"Nigel" wrote in message
...
I currently use the sumif and countif functions to create some control
values in my VBA code when processing the worksheets. All works fine.

However I now wish to modify the use of each of these functions by testing
the criteria for more than one column.

Currently I have something like.... SumIf(A1:A100,"=A",C1:C100), I now
need to test for two columns

Something like..... SumIf(A1:A100,"=A" and B1:B100,"="B", C1:C100),
obviously this does not work in this form. What do I need to do?

I would rather not create helper columns as I have many combinations of
values to sum across......do I need to write it in code or some sort of
array formula?

Many thanks


--
Cheers
Nigel






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 923
Default Multiple Coumns Criteria

Hi Norman
Works great, many thanks

--
Cheers
Nigel



"Norman Jones" wrote in message
...
Hi Nigel,

Try something like:

=SUMPRODUCT((A1:A100="A")*(B1:B100="B"))

and

=SUMPRODUCT((A1:A100="A")*(B1:B100="B")*(C1:C100))

---
Regards,
Norman


"Nigel" wrote in message
...
I currently use the sumif and countif functions to create some control
values in my VBA code when processing the worksheets. All works fine.

However I now wish to modify the use of each of these functions by
testing the criteria for more than one column.

Currently I have something like.... SumIf(A1:A100,"=A",C1:C100), I now
need to test for two columns

Something like..... SumIf(A1:A100,"=A" and B1:B100,"="B", C1:C100),
obviously this does not work in this form. What do I need to do?

I would rather not create helper columns as I have many combinations of
values to sum across......do I need to write it in code or some sort of
array formula?

Many thanks


--
Cheers
Nigel








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
match multiple criteria ina range from multiple criteria multiplet RG Excel Worksheet Functions 8 September 28th 07 04:21 AM
Can I increase the number of coumns in a worksheet? lee Excel Discussion (Misc queries) 3 September 6th 06 01:59 PM
How do I change the color of the Rows and Coumns headings Sunnyside One Setting up and Configuration of Excel 3 October 1st 05 01:17 AM
delete coumns - shift non-blank cells message omb researcher Excel Discussion (Misc queries) 2 September 26th 05 11:07 PM
Clustered column chart with stacked coumns Dave Charts and Charting in Excel 1 January 4th 05 10:40 PM


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