Quickie Sumporduct and 2 wildcards in one column

SCG

Board Regular
Joined
May 27, 2010
Messages
52
Afternoon All,

It is Friday afternoon and my brain has finally given up. Anyone know how I can include two wildcards in the forumla.

=SUMPRODUCT(ISNUMBER(SEARCH("f",B2:B5,1))*(C2:C5="car allowance")*(D2:D5))

I want to look up F and add another wildcard say R for the same column.

=SUMPRODUCT(ISNUMBER(SEARCH("f" & "r",B2:B5,1))*(C2:C5="car allowance")*(D2:D5))

Is this possible?

Thanks all
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Afternoon All,

It is Friday afternoon and my brain has finally given up. Anyone know how I can include two wildcards in the forumla.

=SUMPRODUCT(ISNUMBER(SEARCH("f",B2:B5,1))*(C2:C5="car allowance")*(D2:D5))

I want to look up F and add another wildcard say R for the same column.

=SUMPRODUCT(ISNUMBER(SEARCH("f" & "r",B2:B5,1))*(C2:C5="car allowance")*(D2:D5))

Is this possible?

Thanks all
Which condition applies:

1. if the cell contains F or R
2. if the cell contains F and R
 
Upvote 0
Excel Workbook
ABCDEF
1frCar allowance250010001500
2aCar allowance200
3frCar allowance350
4abc fCar allowance500
5abc rfCar allowance650
1b
Excel 2003
Cell Formulas
RangeFormula
D1=SUMPRODUCT((C2:C5=C1)*(ISNUMBER(SEARCH(A1:B1,B2:B5)))*(D2:D5))
E1=SUMPRODUCT(--(C2:C5=C1),--(ISNUMBER(SEARCH(A1,B2:B5))),--(ISNUMBER(SEARCH(B1,B2:B5))),(D2:D5))
F1=D1-E1
 
Upvote 0
Also...

Either with a constant array of search sitring
Rich (BB code):
=SUMPRODUCT(
     --(MMULT(--ISNUMBER(SEARCH({"f","r"},$B$2:$B$7))+0,
          ROW($B$2:INDEX($B$2:$B$7,COLUMNS({"f","r"})))^0)>0),
     --($C$2:$C$7="car allowance"),
     $D$2:$D$7)
which needs just enter;

Or with a list of search strings in a vertical range of their own:
Rich (BB code):
=SUMPRODUCT(
     --(MMULT(--ISNUMBER(SEARCH(TRANSPOSE(F2:F3),$B$2:$B$7))+0,
          ROW(F2:F3)^0)>0),
     --($C$2:$C$7="car allowance"),
     $D$2:$D$7)
which requires control+shift+enter, not just enter.
 
Upvote 0
Also...

Either with a constant array of search sitring
Rich (BB code):
=SUMPRODUCT(
    --(MMULT(--ISNUMBER(SEARCH({"f","r"},$B$2:$B$7))+0,
         ROW($B$2:INDEX($B$2:$B$7,COLUMNS({"f","r"})))^0)>0),
    --($C$2:$C$7="car allowance"),
    $D$2:$D$7)
which needs just enter;

Or with a list of search strings in a vertical range of their own:
Rich (BB code):
=SUMPRODUCT(
    --(MMULT(--ISNUMBER(SEARCH(TRANSPOSE(F2:F3),$B$2:$B$7))+0,
         ROW(F2:F3)^0)>0),
    --($C$2:$C$7="car allowance"),
    $D$2:$D$7)
which requires control+shift+enter, not just enter.
Why use +0 and "--" on the same expression?

Those can be greatly simplified.
 
Upvote 0

Forum statistics

Threads
1,224,582
Messages
6,179,670
Members
452,936
Latest member
anamikabhargaw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top