Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default SUMPRODUCT with "Contains" criteria

Good afternoon,
Is there any way in which SumProduct can be used with a "contains" criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default SUMPRODUCT with "Contains" criteria

One way

In C1:
=SUMPRODUCT(--ISNUMBER(SEARCH("1A",A1:A100)),B1:B100)

Replace SEARCH with FIND if you need it to be a stricter case sensitive
search. SEARCH is not case sensitive.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Pete Rooney" wrote:
Good afternoon,
Is there any way in which SumProduct can be used with a "contains" criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,646
Default SUMPRODUCT with "Contains" criteria

=SUMPRODUCT(--(NOT(ISERROR(FIND("1A",A1:A100)))),B1:B100)

Regards,
Stefi

€˛Pete Rooney€¯ ezt Ć*rta:

Good afternoon,
Is there any way in which SumProduct can be used with a "contains" criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,118
Default SUMPRODUCT with "Contains" criteria

Try something like this:

With D1 containing the ProdCode segment to find (eg 1A)

This formula returns the sum of sales for ProdCodes containing that code:
E1: =SUMIF(A1:A100,"*"&D1&"*",B1:B100)

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)


"Pete Rooney" wrote in message
...
Good afternoon,
Is there any way in which SumProduct can be used with a "contains"
criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears
in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete



  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default SUMPRODUCT with "Contains" criteria

Max,

Awesome - Singapore to Cheshire UK in less than 5 minutes.

Thank you very much! :-)

Pete

"Max" wrote:

One way

In C1:
=SUMPRODUCT(--ISNUMBER(SEARCH("1A",A1:A100)),B1:B100)

Replace SEARCH with FIND if you need it to be a stricter case sensitive
search. SEARCH is not case sensitive.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Pete Rooney" wrote:
Good afternoon,
Is there any way in which SumProduct can be used with a "contains" criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default SUMPRODUCT with "Contains" criteria

Ron,

This works fine, too!

Thank you very much. :-)

Pete

"Ron Coderre" wrote:

Try something like this:

With D1 containing the ProdCode segment to find (eg 1A)

This formula returns the sum of sales for ProdCodes containing that code:
E1: =SUMIF(A1:A100,"*"&D1&"*",B1:B100)

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)


"Pete Rooney" wrote in message
...
Good afternoon,
Is there any way in which SumProduct can be used with a "contains"
criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears
in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete




  #7   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default SUMPRODUCT with "Contains" criteria

welcome, Pete.
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"Pete Rooney" wrote in message
...
Max,

Awesome - Singapore to Cheshire UK in less than 5 minutes.

Thank you very much! :-)

Pete



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 56
Default SUMPRODUCT with "Contains" criteria

Hi, Stefi,

This works too, as long as you want "1A" only and not "1A" OR "1a".

Thanks very much! :-)

Pete



"Stefi" wrote:

=SUMPRODUCT(--(NOT(ISERROR(FIND("1A",A1:A100)))),B1:B100)

Regards,
Stefi

€˛Pete Rooney€¯ ezt Ć*rta:

Good afternoon,
Is there any way in which SumProduct can be used with a "contains" criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete

  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default SUMPRODUCT with "Contains" criteria

If you change Find to Search, it will treat 1A and 1a the same.

Pete Rooney wrote:

Hi, Stefi,

This works too, as long as you want "1A" only and not "1A" OR "1a".

Thanks very much! :-)

Pete

"Stefi" wrote:

=SUMPRODUCT(--(NOT(ISERROR(FIND("1A",A1:A100)))),B1:B100)

Regards,
Stefi

€˛Pete Rooney€¯ ezt Ć*rta:

Good afternoon,
Is there any way in which SumProduct can be used with a "contains" criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete


--

Dave Peterson
  #10   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 698
Default SUMPRODUCT with "Contains" criteria

I'm glad I could help......Thanks for the feedback.

***********
Regards,
Ron

XL2003, WinXP


"Pete Rooney" wrote:

Ron,

This works fine, too!

Thank you very much. :-)

Pete

"Ron Coderre" wrote:

Try something like this:

With D1 containing the ProdCode segment to find (eg 1A)

This formula returns the sum of sales for ProdCodes containing that code:
E1: =SUMIF(A1:A100,"*"&D1&"*",B1:B100)

Is that something you can work with?
--------------------------

Regards,

Ron (XL2003, Win XP)
Microsoft MVP (Excel)


"Pete Rooney" wrote in message
...
Good afternoon,
Is there any way in which SumProduct can be used with a "contains"
criteria
- for instance, A1:100 contains product codes (for example) AZ1A1100,
ABCZ1A1200, 1A1300 and B1:B100 contains total sales for these products. I
want to extract values from column B for (for example) all products that
CONTAIN the string "1A".
I realise that I could use LEFT, RIGHT or MID as long as the "1A" appears
in
the same place in the string, but I want something to cater for the times
when it doesn't.
Thanks in advance
Pete




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
change "true" and "false" to "availble" and "out of stock" inthestands Excel Worksheet Functions 2 July 19th 07 07:05 PM
SUMPRODUCT(--ISNUMBER(FIND("AM",C5:160))*(k5:k160="") redneck joe Excel Discussion (Misc queries) 5 August 18th 06 08:31 PM
HELP on "left","right","find","len","substitute" functions serene83 Excel Discussion (Misc queries) 5 June 27th 06 02:23 AM
Sumproduct-multiple criteria for same range "OR" Deeds Excel Worksheet Functions 3 May 18th 06 04:43 PM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM


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