SUMIFS with numbers as criteria and wildcard

norts55

Board Regular
Joined
Jul 27, 2012
Messages
191
Hello,
I am trying to write a formula that will sum all of column L (L:L) if column A (A:A) has cells that start with 643 and 647.

Any help would be appreciated as I have been struggling with this. It seems like I am missing something simple.

Thanks in Advance

Excel Formula:
=SUMIFS(L:L,A:A,"643*",A:A,"647*")
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Wildcards don't work with numbers, and even if they did, your formula is ANDing the criteria, which is not possible. You could SUMPRODUCT, or an array formula, or FILTER if you have it (your profile is incomplete on that front) but best to avoid whole column references.
 
Upvote 0
Thanks for the response. I tried SUMPRODUCT but that didn't seem to be what I was looking for.

Maybe this screen shot will help. Column A:A has cells that actually look like they do below (Maybe this will be able to be used in a formula somehow). But there are hundreds of possibilities and the list could grow or shrink by the day. I just need to extract and sum the ones that start with 643 and 647 with a formula so I can easily paste this formula in multiple sheets to get my desired result.


1733852956539.png
 

Attachments

  • 1733852860765.png
    1733852860765.png
    48 KB · Views: 0
Upvote 0
It seems like SUMPRODUCT should work:
=SUMPRODUCT(((INT(A2:A100)=643)+(INT(A2:A100)=647)),L2:L100)
 
Upvote 0
I found this thread that seems to be very close to the same question I have. This worked for them but whatever I try I just cannot get it to work.




1733869481324.png
 
Upvote 0
Your latest data had new additional rows that has alpha characters. What suggested won't work. Basically you have a mix of numerical and text data. You'd need to convert all of them to text.
 
Upvote 0
Ah Ha! Thank you so much. You found the culprit. After I removed those, Scott Huish's formula (=SUMPRODUCT(((INT(A2:A100)=643)+(INT(A2:A100)=647)),L2:L100)) works. But now I have to filter out those lines with alpha characters.
 
Upvote 0
So those lines with the alpha characters could show up at any time. So, somehow I need to filter those out. Would adding "If(ISNumber" somewhere in the formula work? Again, I have tried to place this in and I am having no luck.
 
Upvote 0
Try this:

Excel Formula:
=SUMPRODUCT((LEFT(A2:A100,3)="643")+(LEFT(A2:A100,3)="647"),L2:L100)
 
Upvote 0
Solution

Forum statistics

Threads
1,224,755
Messages
6,180,751
Members
452,996
Latest member
nelsonsix66

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