Sum of column based on partial text and match it with another column

EitanOrgil

New Member
Joined
Jan 8, 2014
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have a table of 11 columns and 864 rows.
I wont to sum up column F (has only numbers) if:
last 6 characters in column c (they are numbers) match the number in column K
and
column G is exact text, say, "ABCDE"

so if in raw 1, column c has "texttexttext123456" and in column K I have 123456, and column G has the exact text "ABCDE", add number in column F to sum
Column C may have the same text more then once, same with column K

I tried with: =sumifs(F:F,C:C,RIGHT(C:C,6)=K:K)
I get SPILL error, spill range too big.

will appreciate any help

Eitan
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
I take it from the fact that you are getting a spill error that you have MS 365.
Please update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also you will get a better response if you provide some sample data using XL2BB.

See if this works for you.
Excel Formula:
=SUM( FILTER(F1:F15, (RIGHT(C1:C15,6)=TRIM(K1:K15)) * (EXACT(G1:G15,"ABCDE")), "") )
 
Upvote 0
I take it from the fact that you are getting a spill error that you have MS 365.
Please update your Account details (or click your user name at the top right of the forum) so helpers always know what Excel version(s) & platform(s) you are using as the best solution often varies by version. (Don’t forget to scroll down & ‘Save’)

Also you will get a better response if you provide some sample data using XL2BB.

See if this works for you.
Excel Formula:
=SUM( FILTER(F1:F15, (RIGHT(C1:C15,6)=TRIM(K1:K15)) * (EXACT(G1:G15,"ABCDE")), "") )
Thank you Alex, Updated my profile to MS 365, and OS.
tried your solution, I get the #Value! error, Error in Value.
Attaching XL2BB, first 50 rows:
01.2021-04.2023_RCR_QA_StockMoves.xlsx
ABCDEFGHIJ
1DateProductReferenceOriginQuantityMoveDestinationQuantityTrigramJob
212/04/2021 13:57:24Product1.2.3.4:20210309_J121458Production - controls050Reception - B0PEL121458
312/04/2021 13:57:52Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
413/04/2021 11:26:39Product1.2.3.4:20210309_J121458Production Room5050Consumption0PEL121554
519/04/2021 13:25:49Product1.2.3.4:20210309_J121458Production - controls-5050Reception - B0PEL121458
619/04/2021 13:26:19Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
719/04/2021 13:31:21Product1.2.3.4:20210309_J121458Production Room5050Consumption50PEL121575
820/04/2021 14:05:20Product1.2.3.4:20210309_J121458Production - controls-10050Reception - B0PEL121458
920/04/2021 14:05:29Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
1020/04/2021 14:06:17Product1.2.3.4:20210309_J121458Production Room5050Consumption100PEL121585
1121/04/2021 10:26:36Product1.2.3.4:20210309_J121458Production - controls-150456Reception - B0PEL121458
1221/04/2021 10:26:46Product1.2.3.4:20210309_J121458Reception - B456456Production Room0DPE
1321/04/2021 10:27:55Product1.2.3.4:20210309_J121458Production Room456200Consumption150PEL121593
1425/04/2021 14:11:00Product1.2.3.4:20210309_J121458Production Room256200Consumption350PEL121608
1526/04/2021 09:27:08Product1.2.3.4:20210309_J121458Production - controls-606944Reception - B0PEL121458
1626/04/2021 09:27:51Product1.2.3.4:20210309_J121458Reception - B944944Production Room56DPE
1726/04/2021 09:29:03Product1.2.3.4:20210309_J121458Production Room10001000Consumption550PEL121614
1826/04/2021 12:38:20Product1.2.3.4:20210309_J121458Production - controls-15503000Reception - B0PEL121458
1926/04/2021 12:38:37Product1.2.3.4:20210309_J121458Reception - B30003000Production Room0DPE
2026/04/2021 12:41:49Product1.2.3.4:20210309_J121458Production Room30003000Consumption1550PEL121623
2126/04/2021 13:37:27Product1.2.3.4:20210309_J121458Production - controls-455021554Reception - B0PEL121458
2226/04/2021 13:38:16Product1.2.3.4:20210309_J121458Reception - B2155421554Production Room0DPE
2302/05/2021 09:38:46Product1.2.3.4:20210309_J121458Production Room215548353Consumption4550PEL121644
2403/05/2021 10:58:29Product1.2.3.4:20210426_J121613Production - controls027891Reception0PEL121613
2503/05/2021 10:58:49Product1.2.3.4:20210426_J121613Reception2789127891Production Room0DPE
2603/05/2021 11:14:45Product1.2.3.4:20210309_J121458Init0272Production Room13201DPE
2705/05/2021 14:14:50Product1.2.3.4:20210309_J121458Consumption129035702 Machine Failure0DPE121644
2805/05/2021 14:28:34Product1.2.3.4:20210426_J121613Dummytemppfingaches020Dummytempgaches0DPE121613
2905/05/2021 14:28:35Product1.2.3.4:20210426_J121613Dummytempgaches202005 Testing Gaches0DPE121613
3005/05/2021 14:28:36Product1.2.3.4:20210426_J121613Dummytemppfingaches-20889Dummytempgaches0DPE121613
3105/05/2021 14:28:37Product1.2.3.4:20210426_J121613Dummytempgaches88988902 Machine Failure0DPE121613
3205/05/2021 14:29:00Product1.2.3.4:20210309_J121458Dummytemppfingaches02329Dummytempgaches0DPE121458
3305/05/2021 14:29:01Product1.2.3.4:20210309_J121458Dummytempgaches2329232902 Machine Failure57DPE121458
3405/05/2021 14:29:02Product1.2.3.4:20210309_J121458Dummytemppfingaches-232920Dummytempgaches0DPE121458
3505/05/2021 14:29:03Product1.2.3.4:20210309_J121458Dummytempgaches202005 Testing Gaches0DPE121458
3605/05/2021 15:00:06Product1.2.3.4:20210309_J121458Production Room1347310Consumption12846PEL121669
3705/05/2021 16:50:59Product1.2.3.4:20210309_J121458Production Room1346312869Consumption12856PEL121674
3809/05/2021 14:11:07Product1.2.3.4:20210426_J121613Production Room2789112963Consumption0PEL121690
3910/05/2021 12:43:59Product1.2.3.4:20210426_J121613Production Room1492812655Consumption12963PEL121698
4010/05/2021 13:00:58Product1.2.3.4:20210309_J121458Production Room59427204 Other0DPE
4110/05/2021 15:27:13Product1.2.3.4:20210309_J121458Consumption257251602 Machine Failure2386DPE121674
4211/05/2021 15:51:06Product1.2.3.4:20210511_J121710Production - controls09656Reception0PEL121710
4311/05/2021 15:51:28Product1.2.3.4:20210511_J121710Reception96569656Production Room0DPE
4411/05/2021 15:55:30Product1.2.3.4:20210511_J121710Production Room96569656Consumption0PEL121711
4512/05/2021 15:39:59Product1.2.3.4:20210511_J121710Production - controls-965612897Reception0PEL121710
4612/05/2021 15:40:11Product1.2.3.4:20210511_J121710Reception1289712897Production Room0DPE
4712/05/2021 15:42:05Product1.2.3.4:20210511_J121710Consumption9656806 Qa Rejects0DPE121711
4812/05/2021 15:43:12Product1.2.3.4:20210511_J121710Production Room1289712897Consumption9648PEL121719
4913/05/2021 10:33:40Product1.2.3.4:20210511_J121710Production - controls-225536049Reception0PEL121710
5013/05/2021 10:34:06Product1.2.3.4:20210511_J121710Reception60496049Production Room0DPE
Sheet1
 
Upvote 0
Try this:

Book2
ABCDEFGHIJKLM
1DateProductReferenceOriginQuantityMoveDestinationQuantityTrigramJobText to find -->Dummytempgaches
212/04/2021 13:57Product1.2.3.4:20210309_J121458Production - controls050Reception - B0PEL121458Sum with criteria -->3,258
312/04/2021 13:57Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
413/04/2021 11:26Product1.2.3.4:20210309_J121458Production Room5050Consumption0PEL121554
519/04/2021 13:25Product1.2.3.4:20210309_J121458Production - controls-5050Reception - B0PEL121458
619/04/2021 13:26Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
719/04/2021 13:31Product1.2.3.4:20210309_J121458Production Room5050Consumption50PEL121575
820/04/2021 14:05Product1.2.3.4:20210309_J121458Production - controls-10050Reception - B0PEL121458
920/04/2021 14:05Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
1020/04/2021 14:06Product1.2.3.4:20210309_J121458Production Room5050Consumption100PEL121585
1121/04/2021 10:26Product1.2.3.4:20210309_J121458Production - controls-150456Reception - B0PEL121458
1221/04/2021 10:26Product1.2.3.4:20210309_J121458Reception - B456456Production Room0DPE
1321/04/2021 10:27Product1.2.3.4:20210309_J121458Production Room456200Consumption150PEL121593
1425/04/2021 14:11Product1.2.3.4:20210309_J121458Production Room256200Consumption350PEL121608
1526/04/2021 9:27Product1.2.3.4:20210309_J121458Production - controls-606944Reception - B0PEL121458
1626/04/2021 9:27Product1.2.3.4:20210309_J121458Reception - B944944Production Room56DPE
1726/04/2021 9:29Product1.2.3.4:20210309_J121458Production Room10001000Consumption550PEL121614
1826/04/2021 12:38Product1.2.3.4:20210309_J121458Production - controls-15503000Reception - B0PEL121458
1926/04/2021 12:38Product1.2.3.4:20210309_J121458Reception - B30003000Production Room0DPE
2026/04/2021 12:41Product1.2.3.4:20210309_J121458Production Room30003000Consumption1550PEL121623
2126/04/2021 13:37Product1.2.3.4:20210309_J121458Production - controls-455021554Reception - B0PEL121458
2226/04/2021 13:38Product1.2.3.4:20210309_J121458Reception - B2155421554Production Room0DPE
232/05/2021 9:38Product1.2.3.4:20210309_J121458Production Room215548353Consumption4550PEL121644
243/05/2021 10:58Product1.2.3.4:20210426_J121613Production - controls027891Reception0PEL121613
253/05/2021 10:58Product1.2.3.4:20210426_J121613Reception2789127891Production Room0DPE
263/05/2021 11:14Product1.2.3.4:20210309_J121458Init0272Production Room13201DPE
275/05/2021 14:14Product1.2.3.4:20210309_J121458Consumption129035702 Machine Failure0DPE121644
285/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytemppfingaches020Dummytempgaches0DPE121613
295/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytempgaches202005 Testing Gaches0DPE121613
305/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytemppfingaches-20889Dummytempgaches0DPE121613
315/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytempgaches88988902 Machine Failure0DPE121613
325/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytemppfingaches02329Dummytempgaches0DPE121458
335/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytempgaches2329232902 Machine Failure57DPE121458
345/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytemppfingaches-232920Dummytempgaches0DPE121458
355/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytempgaches202005 Testing Gaches0DPE121458
365/05/2021 15:00Product1.2.3.4:20210309_J121458Production Room1347310Consumption12846PEL121669
375/05/2021 16:50Product1.2.3.4:20210309_J121458Production Room1346312869Consumption12856PEL121674
389/05/2021 14:11Product1.2.3.4:20210426_J121613Production Room2789112963Consumption0PEL121690
3910/05/2021 12:43Product1.2.3.4:20210426_J121613Production Room1492812655Consumption12963PEL121698
4010/05/2021 13:00Product1.2.3.4:20210309_J121458Production Room59427204 Other0DPE
4110/05/2021 15:27Product1.2.3.4:20210309_J121458Consumption257251602 Machine Failure2386DPE121674
4211/05/2021 15:51Product1.2.3.4:20210511_J121710Production - controls09656Reception0PEL121710
4311/05/2021 15:51Product1.2.3.4:20210511_J121710Reception96569656Production Room0DPE
4411/05/2021 15:55Product1.2.3.4:20210511_J121710Production Room96569656Consumption0PEL121711
4512/05/2021 15:39Product1.2.3.4:20210511_J121710Production - controls-965612897Reception0PEL121710
4612/05/2021 15:40Product1.2.3.4:20210511_J121710Reception1289712897Production Room0DPE
4712/05/2021 15:42Product1.2.3.4:20210511_J121710Consumption9656806 Qa Rejects0DPE121711
4812/05/2021 15:43Product1.2.3.4:20210511_J121710Production Room1289712897Consumption9648PEL121719
4913/05/2021 10:33Product1.2.3.4:20210511_J121710Production - controls-225536049Reception0PEL121710
5013/05/2021 10:34Product1.2.3.4:20210511_J121710Reception60496049Production Room0DPE
Sheet1
Cell Formulas
RangeFormula
M2M2=SUM( FILTER(F2:F50, (RIGHT(C2:C50,6)=TRIM(J2:J50)) * (EXACT(G2:G50,$M$1)), 0) )
 
Upvote 0
Solution
Thank you Alex, this works, and I can even select different matches.(y)
Try this:

Book2
ABCDEFGHIJKLM
1DateProductReferenceOriginQuantityMoveDestinationQuantityTrigramJobText to find -->Dummytempgaches
212/04/2021 13:57Product1.2.3.4:20210309_J121458Production - controls050Reception - B0PEL121458Sum with criteria -->3,258
312/04/2021 13:57Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
413/04/2021 11:26Product1.2.3.4:20210309_J121458Production Room5050Consumption0PEL121554
519/04/2021 13:25Product1.2.3.4:20210309_J121458Production - controls-5050Reception - B0PEL121458
619/04/2021 13:26Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
719/04/2021 13:31Product1.2.3.4:20210309_J121458Production Room5050Consumption50PEL121575
820/04/2021 14:05Product1.2.3.4:20210309_J121458Production - controls-10050Reception - B0PEL121458
920/04/2021 14:05Product1.2.3.4:20210309_J121458Reception - B5050Production Room0DPE
1020/04/2021 14:06Product1.2.3.4:20210309_J121458Production Room5050Consumption100PEL121585
1121/04/2021 10:26Product1.2.3.4:20210309_J121458Production - controls-150456Reception - B0PEL121458
1221/04/2021 10:26Product1.2.3.4:20210309_J121458Reception - B456456Production Room0DPE
1321/04/2021 10:27Product1.2.3.4:20210309_J121458Production Room456200Consumption150PEL121593
1425/04/2021 14:11Product1.2.3.4:20210309_J121458Production Room256200Consumption350PEL121608
1526/04/2021 9:27Product1.2.3.4:20210309_J121458Production - controls-606944Reception - B0PEL121458
1626/04/2021 9:27Product1.2.3.4:20210309_J121458Reception - B944944Production Room56DPE
1726/04/2021 9:29Product1.2.3.4:20210309_J121458Production Room10001000Consumption550PEL121614
1826/04/2021 12:38Product1.2.3.4:20210309_J121458Production - controls-15503000Reception - B0PEL121458
1926/04/2021 12:38Product1.2.3.4:20210309_J121458Reception - B30003000Production Room0DPE
2026/04/2021 12:41Product1.2.3.4:20210309_J121458Production Room30003000Consumption1550PEL121623
2126/04/2021 13:37Product1.2.3.4:20210309_J121458Production - controls-455021554Reception - B0PEL121458
2226/04/2021 13:38Product1.2.3.4:20210309_J121458Reception - B2155421554Production Room0DPE
232/05/2021 9:38Product1.2.3.4:20210309_J121458Production Room215548353Consumption4550PEL121644
243/05/2021 10:58Product1.2.3.4:20210426_J121613Production - controls027891Reception0PEL121613
253/05/2021 10:58Product1.2.3.4:20210426_J121613Reception2789127891Production Room0DPE
263/05/2021 11:14Product1.2.3.4:20210309_J121458Init0272Production Room13201DPE
275/05/2021 14:14Product1.2.3.4:20210309_J121458Consumption129035702 Machine Failure0DPE121644
285/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytemppfingaches020Dummytempgaches0DPE121613
295/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytempgaches202005 Testing Gaches0DPE121613
305/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytemppfingaches-20889Dummytempgaches0DPE121613
315/05/2021 14:28Product1.2.3.4:20210426_J121613Dummytempgaches88988902 Machine Failure0DPE121613
325/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytemppfingaches02329Dummytempgaches0DPE121458
335/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytempgaches2329232902 Machine Failure57DPE121458
345/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytemppfingaches-232920Dummytempgaches0DPE121458
355/05/2021 14:29Product1.2.3.4:20210309_J121458Dummytempgaches202005 Testing Gaches0DPE121458
365/05/2021 15:00Product1.2.3.4:20210309_J121458Production Room1347310Consumption12846PEL121669
375/05/2021 16:50Product1.2.3.4:20210309_J121458Production Room1346312869Consumption12856PEL121674
389/05/2021 14:11Product1.2.3.4:20210426_J121613Production Room2789112963Consumption0PEL121690
3910/05/2021 12:43Product1.2.3.4:20210426_J121613Production Room1492812655Consumption12963PEL121698
4010/05/2021 13:00Product1.2.3.4:20210309_J121458Production Room59427204 Other0DPE
4110/05/2021 15:27Product1.2.3.4:20210309_J121458Consumption257251602 Machine Failure2386DPE121674
4211/05/2021 15:51Product1.2.3.4:20210511_J121710Production - controls09656Reception0PEL121710
4311/05/2021 15:51Product1.2.3.4:20210511_J121710Reception96569656Production Room0DPE
4411/05/2021 15:55Product1.2.3.4:20210511_J121710Production Room96569656Consumption0PEL121711
4512/05/2021 15:39Product1.2.3.4:20210511_J121710Production - controls-965612897Reception0PEL121710
4612/05/2021 15:40Product1.2.3.4:20210511_J121710Reception1289712897Production Room0DPE
4712/05/2021 15:42Product1.2.3.4:20210511_J121710Consumption9656806 Qa Rejects0DPE121711
4812/05/2021 15:43Product1.2.3.4:20210511_J121710Production Room1289712897Consumption9648PEL121719
4913/05/2021 10:33Product1.2.3.4:20210511_J121710Production - controls-225536049Reception0PEL121710
5013/05/2021 10:34Product1.2.3.4:20210511_J121710Reception60496049Production Room0DPE
Sheet1
Cell Formulas
RangeFormula
M2M2=SUM( FILTER(F2:F50, (RIGHT(C2:C50,6)=TRIM(J2:J50)) * (EXACT(G2:G50,$M$1)), 0) )
 
Upvote 0

Forum statistics

Threads
1,215,095
Messages
6,123,072
Members
449,093
Latest member
ripvw

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