Sumif combinations of a number

Joined
Jan 13, 2021
Messages
20
Office Version
  1. 2007
Platform
  1. Windows
=SUMIFS(AD2:AD1000, AF2:AF1000, "*123*")

The formula above is supposed to find all combinations of 123 in column AD and sums up the corresponding cells in column AF. By combinations of 123, I mean:

123
132
231
213
312
321

The code just returns the value "0" to me. What can be done? Take note, I use Excel 2007.

Thank you
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
did you enter with CNTL-SHFT-ENTER keystroke?
=SUMPRODUCT((AD2:AD7)*(ISNUMBER(FIND(MID(AE1,1,1),AF2:AF7)))*(ISNUMBER(FIND(MID(AE1,2,1),AF2:AF7)))*(ISNUMBER(FIND(MID(AE1,3,1),AF2:AF7))))

Odd thing, when I enter this formula in a new sheet with the numbers you provided, it works. But on my sheet with my numbers, the same formula always gives me 0. Could it be misreading the numbers some how? I even tried a helper column for the same numbers but it just won't work properly.
 
Upvote 0
then your numbers are probably text or in cells that are formatted as text. To check this, change the format of the cells to General or try to add decimal spaces.
 
Upvote 0
=SUMPRODUCT((AD2:AD7)*(ISNUMBER(FIND(MID(AE1,1,1),AF2:AF7)))*(ISNUMBER(FIND(MID(AE1,2,1),AF2:AF7)))*(ISNUMBER(FIND(MID(AE1,3,1),AF2:AF7))))

Odd thing, when I enter this formula in a new sheet with the numbers you provided, it works. But on my sheet with my numbers, the same formula always gives me 0. Could it be misreading the numbers some how? I even tried a helper column for the same numbers but it just won't work properly.
I'm happy you marked one of my posts as the answer. But, are you sure the post you selected was the best answer given?
 
Upvote 0
I'm happy you marked one of my posts as the answer. But, are you sure the post you selected was the best answer given?
=SUMPRODUCT((C2:C1000)*
(ISNUMBER(FIND(MID(D2,1,1),A2:A1000)))*
(ISNUMBER(FIND(MID(D2,2,1),A2:A1000)))*
(ISNUMBER(FIND(MID(D2,3,1),A2:A1000)))
)

Your formula works perfect when all 3 digits are different. But when 2 or 3 digits are same, the formula fails. I've been trying to figure it out on my own - didn't want to bother you as you've already helped a lot. I've been trying to get that to work if the number in D2 is 000 or 333, 002, 100 - numbers like that fail the formula.
 
Upvote 0
Okay, how are you typing in three zeros and having it display? Are you using text?
If you format your search criteria cell as 000.# (you'll always have the decimal) it works for me:
Mr Excel Questions 73.xlsm
ADAEAFAG
1target:333.Sum:731
2120123.00
3121132.00
4121231.00
5123213.00
6124312.00
7122321.00
8
wonderfulsomebod
Cell Formulas
RangeFormula
AG1AG1=SUMPRODUCT((AD2:AD7)* (ISNUMBER(FIND(MID(AE1,1,1),AF2:AF7)))* (ISNUMBER(FIND(MID(AE1,2,1),AF2:AF7)))* (ISNUMBER(FIND(MID(AE1,3,1),AF2:AF7))) )
 
Upvote 0

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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