Sumproduct /Search function with Wildcard

nmounir

Board Regular
Joined
Oct 16, 2020
Messages
107
Office Version
  1. 365
Platform
  1. Windows
Hello Everyone,

I am trying to use Sumproduct along with the search function instead of SUMIFS to conduct an logical text. Part this of formula is finding the cost of the 8 1/2" section. (drilling phases for oil wells). I am looking to get the cost of 8 1/2" regardless if is 8 1/2" or 8 1/2" ST. it is easily doable with SUMIFS but i cannot do it with sumproduct and the search function using wildcards. Your help is greatly appreciated.

1674501167083.png
 

Attachments

  • 1674500981693.png
    1674500981693.png
    38.1 KB · Views: 10

Excel Facts

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
Try
Excel Formula:
search(G4,D3:D8)
It worked but I think I didn't explain it well. I am unable to use wildcard with sumproduct. as you can see below, i am getting 150 with SUMIFS and 190 with sumproduct and the search functions. I am looking here for the cost of 8 1/2" followed by any character and not 8 1/2" only. SUMIFS is giving the correct answer but not Sumproduct doesn't

1674503117969.png
 
Upvote 0
There is no need to use the wildcard when using search.
The sumproduct formula does work, but it's simply not doing what you want. Just stick with the sumifs, it's far better.
 
Upvote 0
There is no need to use the wildcard when using search.
The sumproduct formula does work, but it's simply not doing what you want. Just stick with the sumifs, it's far better.
The reason why I have to use Sumproduct is because this is just part of the formula, the rest of he formula consists of a OR logical test so I have to use Sumproduct. SUMIFS doesn't do or logical test.
 
Upvote 0
In that case can you please post some sample data, along with what you are trying to do.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0
In that case can you please post some sample data, along with what you are trying to do.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
I added the XL2BB but I can't use it for some reason. the Excel mini sheet is grayed out also. how can i send it?

1674542253698.png
 
Upvote 0
H3:
Excel Formula:
=SUMPRODUCT(IFERROR(SEARCH(G3&"*",D3:D8),0)*E3:E8)
 

Attachments

  • 1674552507994.png
    1674552507994.png
    29.7 KB · Views: 8
Upvote 0
the Excel mini sheet is grayed out also
You could see if this helps..

am looking here for the cost of 8 1/2" followed by any character
You're still probably better explaining the full picture - but for your specific question - here's one option.
Book1
DEFGH
38 1/2"1008 1/2"150
48 1/2" ST508 1/2"150
5ST 8 1/2" ST40
612 1/4"30
712 1/4" ST80
812 1/4" APP60
Sheet1
Cell Formulas
RangeFormula
H3H3=SUMIFS(E3:E8,D3:D8,G3&"*")
H4H4=SUMPRODUCT(E3:E8,--(LEFT(D3:D8,LEN(G4))=G4))
 
Upvote 0
If you only want to match the start, you could use:

Excel Formula:
=SUMPRODUCT(E3:E8,--(IFERROR(SEARCH(G3,$D$3:$D$8),0)=1))
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,967
Members
452,371
Latest member
Frana

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