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: 4
You could see if this helps..


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))
Hello

I am trying to calculate the cost (in column D) of all corrosion products (Corrosion A, Corrosion B, Corrosion C and Corrosion D) in column C that were used in the 8 1/2" and 8 1/2" ST sections (Column B) in Well 1. This is an Or logical test where I cannot use SUMIFS. I tried Sumproduct in cell E3 and you can find the formulatext in E5 and i didn't get the correct result because it calculated the 8 1/2" only. I tried SUMPRODUCT in cell G3 where I used the search function with an asterisk and the result was wrong because it included the 8 1/2", 8 1/2" ST and APP 8 1/2". I am looking for 8 1/2" and 8 1/2" ST only.
I then figured to use SUMIFS multiple times and add the outputs. Please see result in Cell E4 (formulatext in E8). This one got the correct answer which is 389.
the correct criterias are the ones I marked in green whereas the ones in yellow are not to be included.
I found the answer using multiple SUMIFS just today. However, before i found this answer i was trying yesterday to solve it with sumproduct and the search function. Is there a way to solve it with Sumproduct?

1674581487772.png
 

Attachments

  • 1674580745086.png
    1674580745086.png
    79.9 KB · Views: 4
  • 1674581020924.png
    1674581020924.png
    79.4 KB · Views: 2
  • 1674581425978.png
    1674581425978.png
    77.7 KB · Views: 4
Upvote 0

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney
How about
Excel Formula:
=SUM(SUMIFS(D3:D35,A3:A35,"Well 1",B3:B35,H1&"*",C3:C35,{"Corrosion A","Corrosion B","Corrosion C"}))
 
Upvote 0
Solution
Glad we could help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,598
Messages
6,120,441
Members
448,966
Latest member
DannyC96

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