in SUM condition needs to check for a name and its variation. "*" ?

nahaku

Board Regular
Joined
Mar 19, 2020
Messages
106
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
=SUMIFS(Table4[PCS],Table4[staff],IFS(Table4[staff]=$BP57,$BP57,Table4[staff]="GRS-"&$BP57,"GRS-"&$BP57),Table4[data_source],"GRS")
with this function I will get long array with same numbers, not one number as SUM. It seems like it is just suming all numbers if it is the condition True, not as one :{

I have a column of names where the names are like ABC54646 and sometime it is with GRS-ABC54646, Normaly I would use power query to get rid of it, but I do not want to add aditional tabels as this file will have too many of them already because it will be monthly summary.

Firstly I wanted use just "*" before Cell reference but It then cant look up somethink like ....ABC54646 it would look up "*$BP7" and of course it fails....
Any suggestions?
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Any chance of a small set of sample data and expected results with XL2BB?
Giving us no data or results no layout and a formula that does not do what you want it to, doesn't make it easy for us to replicate what you have or want. ;)
 
Upvote 0
Any chance of a small set of sample data and expected results with XL2BB?
Giving us no data or results no layout and a formula that does not do what you want it to, doesn't make it easy for us to replicate what you have or want. ;)

Test of Packing KPI monthly Test.xlsx
BCDEFGHIJKLMNOPQ
1stafftimesPCSweightvolume
2stafftimesPCSweightvolumePutawayTime on differentGRSTarg/H
3GRS-ABC01560637.020.584496Time [H]PcsWeightVolumePCs / Hour700
4GRS-ABC015620120.02457ABC015600.0000.000.00  
5GRS-ABC015615713.870.02312ABC034700.0000.000.00  
6GRS-ABC01561911.970.006732ABC015700.0000.000.00  
7GRS-ABC01562113.320.023936ABC020900.0000.000.00  
8GRS-ABC01562313.10.0201301.0347213.592.2445.556.5%
9GRS-ABC0156126140.01844401.0347213.592.2445.556.5%
10GRS-ABC01562613.980.02016301.0347213.592.2445.556.5%
11GRS-ABC01562313.350.0495901.0347213.592.2445.556.5%
12GRS-ABC01562313.350.0495901.0347213.592.2445.556.5%
13GRS-ABC015659821.520.02125
14GRS-ABC01562821.660.0084
15GRS-ABC01562312.30.01248
16GRS-ABC015621210.003888
17GRS-ABC01562911.690.0074
18GRS-ABC01562923.760.010962
19GRS-ABC0156591130.078052
20GRS-ABC01562411.80.025308
21GRS-ABC015625412.030.05742
22GRS-ABC01562210.30.001408
23GRS-ABC01563114.360.01624
24GRS-ABC015611714.460.123525
25GRS-ABC015619115.390.075696
26GRS-ABC01562610.2110.00156
27GRS-ABC01561610.2670.00112
28GRS-ABC01561510.650.009072
29GRS-ABC015619010.970.00966
30GRS-ABC01568611.8360.01728
31GRS-ABC015694211.70.016105
32GRS-ABC015612211.70.016105
33GRS-ABC01563117.10.04508
34GRS-ABC015621211.70.016105
35GRS-ABC01564211.640.01728
36GRS-ABC01568811.640.01728
37GRS-ABC01565410.070.000413
38GRS-ABC01562112.580.0054
39ABC015711128.10.2754
40ABC015715128.10.2754
41ABC01570128.10.2754
42ABC0209060630.86688
43ABC0209479604561.65957
44ABC02092860133.20.41496
45ABC020933660196.440.814275
46ABC020909619.20.058205
47ABC02099796119.4240.576576
Sheet1
Cell Formulas
RangeFormula
J4:J12J4=SUMIFS(Table2[Destroy Pick],Table2[Login],$I4)
K4:K12K4=SUMIFS(Table4[times],Table4[staff],"*"&$I4,Table4[data_source],"GRS")/3600
L4:L12L4=SUMIFS(Table4[PCS],Table4[staff],"*"&$I4,Table4[data_source],"GRS")
M4:M12M4=SUMIFS(Table4[weight],Table4[staff],"*"&$I4,Table4[data_source],"GRS")
N4:N12N4=SUMIFS(Table4[volume],Table4[staff],"*"&$I4,Table4[data_source],"GRS")
O4:O12O4=IFERROR(L4/K4,"")
P4:P12P4=IFERROR((O4/$P$3),"")
 
Upvote 0
Thanks, but that has raised some more questions.

I asked for the expected results. Did you provide them?
If so, where in that sheet are they?
If not, please provide them as well as an explanation of how to get them manually.

You have shown a formula that includes Table2[Destroy Pick]
I presume that means that I cannot see Table2? Do I need to know about Table2?

I can see 'times', 'staff', 'PCS' etc columns in the left hand table, but not 'data_source'. Does that mean the left hand table is not Table4 or that 'data_source' is perhaps not shown (cloumn A?)? Do I need to know about 'data_source'?

Remember that you are very familiar with your sheet, data, layout & what you want. We have no idea unless you spell it out very clearly.
 
Upvote 0
Thanks, but that has raised some more questions.

I asked for the expected results. Did you provide them?
If so, where in that sheet are they?
If not, please provide them as well as an explanation of how to get them manually.

You have shown a formula that includes Table2[Destroy Pick]
I presume that means that I cannot see Table2? Do I need to know about Table2?

I can see 'times', 'staff', 'PCS' etc columns in the left hand table, but not 'data_source'. Does that mean the left hand table is not Table4 or that 'data_source' is perhaps not shown (cloumn A?)? Do I need to know about 'data_source'?

Remember that you are very familiar with your sheet, data, layout & what you want. We have no idea unless you spell it out very clearly.

the other tab is different, there I have no problems, but I have problems to sum rows for ABC0156 when in this tab I post here is instead of ABC0156 is GRS-ABC0156 . =SUMIFS(Table4[PCS],Table4[staff],"*"&$I4,Table4[data_source],"GRS") => [staff] is column B and datasouse would be Column A if is here, there are value only GRS and Other... and I need to sum values in column D what is equivalent of [PCS] . Criterium is in Column "i" what it should be looking for, as you can see when i use as criteria "*"&$I4 it is only counting something wrong, probably empty cells... weight and volum sum would be just substitution of [PCS] for the column i need to sum.
 
Upvote 0
Again you have given a formula that does not work, no expected results and sample data with a column missing. Hard to help when you don't have all the data required or know what result should be returned. :(

What I can say is that if I add a data_source column to that left table and enter "GRS" in all rows then the PCS formula on the right returns 45 for ABC0156.
 
Upvote 0
Again you have given a formula that does not work, no expected results and sample data with a column missing. Hard to help when you don't have all the data required or know what result should be returned. :(

What I can say is that if I add a data_source column to that left table and enter "GRS" in all rows then the PCS formula on the right returns 45 for ABC0156.

I thought I was clear, that I need to SUM those cells where in row is Name with prefix "GRS-" If you missunderstand me, I am sorry, English is not my language.
Test of Packing KPI monthly Test.xlsx
BCDEFGHIJKLMNO
1How it should look
2stafftimesPCSweightvolumedata_sourcePutawayTime on Diff depGRS
3stafftimesPCSweightvolumedata_sourceTimePcsWeightVolumePCs / Hour
4GRS-ABC01560637.020.584496GRSABC0157026.00384.300.83415.38
5GRS-ABC015620120.02457GRSABC008700.0000.000.00 
6GRS-ABC015615713.870.02312GRSABC020900.0000.000.00 
7GRS-ABC01561911.970.006732GRSABC015603709.0045131.291.4443.68
8GRS-ABC01562113.320.023936GRS 
9GRS-ABC01562313.10.02013GRS 
10GRS-ABC0156126140.018444GRS 
11GRS-ABC01562613.980.020163GRS 
12GRS-ABC01562313.350.04959GRS 
13GRS-ABC01562313.350.04959GRSwhat I usually use…. Down here
14GRS-ABC015659821.520.02125GRSTime PcsWeightVolume
15GRS-ABC01562821.660.0084GRSABC015726384.30.8262
16GRS-ABC01562312.30.01248GRSABC00870000
17GRS-ABC015621210.003888GRSABC02090000
18GRS-ABC01562911.690.0074GRSABC01560000
19GRS-ABC01562923.760.010962GRS0000
20GRS-ABC0156591130.078052GRS0000
21GRS-ABC01562411.80.025308GRS0000
22GRS-ABC015625412.030.05742GRS
23GRS-ABC01562210.30.001408GRS
24GRS-ABC01563114.360.01624GRS
25GRS-ABC015611714.460.123525GRS
26GRS-ABC015619115.390.075696GRS
27GRS-ABC01562610.2110.00156GRS
28GRS-ABC01561610.2670.00112GRS
29GRS-ABC01561510.650.009072GRS
30GRS-ABC015619010.970.00966GRS
31GRS-ABC01568611.8360.01728GRS
32GRS-ABC015694211.70.016105GRS
33GRS-ABC015612211.70.016105GRS
34GRS-ABC01563117.10.04508GRS
35GRS-ABC015621211.70.016105GRS
36GRS-ABC01564211.640.01728GRS
37GRS-ABC01568811.640.01728GRS
38GRS-ABC01565410.070.000413GRS
39GRS-ABC01562112.580.0054GRS
40ABC015711128.10.2754GRS
41ABC015715128.10.2754GRS
42ABC01570128.10.2754GRS
43ABC0209060630.86688XCF
44ABC0209479604561.65957XCF
45ABC02092860133.20.41496XCF
46ABC020933660196.440.814275XCF
47ABC020909619.20.058205XCF
48ABC02099796119.4240.576576XCF
Sheet1
Cell Formulas
RangeFormula
O4:O12O4=IFERROR(L4/(K4/3600),"")
K15:K21K15=SUMIFS(C3:C48,B3:B48,J15,G3:G48,"GRS")
L15:L21L15=SUMIFS(D3:D48,B3:B48,J15,G3:G48,"GRS")
M15:M21M15=SUMIFS(E3:E48,B3:B48,J15,G3:G48,"GRS")
N15:N21N15=SUMIFS(F3:F48,B3:B48,J15,G3:G48,"GRS")
 
Upvote 0
If you missunderstand me, I am sorry, English is not my language.
Exactly why I wanted the expected results as there is no language issue then. ;)


As far as I can see, formulas of the form you showed in post #3 produce those expected results. Here is my sheet with those formulas (slightly adjusted for different row numbers)

BTW, why does the table in columns B:G have two identical header rows?

nahaku 2020-04-18 2.xlsm
BCDEFGHIJKLMNO
1
2How it should look
3stafftimesPCSweightvolumedata_sourcePutawayTime on Diff depGRS
4stafftimesPCSweightvolumedata_sourceTimePcsWeightVolumePCs / Hour
5GRS-ABC01560637.020.584496GRSABC0157026384.30.8262415.3846154
6GRS-ABC015620120.02457GRSABC008700000 
7GRS-ABC015615713.870.02312GRSABC020900000 
8GRS-ABC01561911.970.006732GRSABC01560370945131.2941.4352643.67754112
9GRS-ABC01562113.320.023936GRS
10GRS-ABC01562313.10.02013GRS
11GRS-ABC0156126140.018444GRS
12GRS-ABC01562613.980.020163GRS
13GRS-ABC01562313.350.04959GRS
14GRS-ABC01562313.350.04959GRS
15GRS-ABC015659821.520.02125GRS
16GRS-ABC01562821.660.0084GRS
17GRS-ABC01562312.30.01248GRS
18GRS-ABC015621210.003888GRS
19GRS-ABC01562911.690.0074GRS
20GRS-ABC01562923.760.010962GRS
21GRS-ABC0156591130.078052GRS
22GRS-ABC01562411.80.025308GRS
23GRS-ABC015625412.030.05742GRS
24GRS-ABC01562210.30.001408GRS
25GRS-ABC01563114.360.01624GRS
26GRS-ABC015611714.460.123525GRS
27GRS-ABC015619115.390.075696GRS
28GRS-ABC01562610.2110.00156GRS
29GRS-ABC01561610.2670.00112GRS
30GRS-ABC01561510.650.009072GRS
31GRS-ABC015619010.970.00966GRS
32GRS-ABC01568611.8360.01728GRS
33GRS-ABC015694211.70.016105GRS
34GRS-ABC015612211.70.016105GRS
35GRS-ABC01563117.10.04508GRS
36GRS-ABC015621211.70.016105GRS
37GRS-ABC01564211.640.01728GRS
38GRS-ABC01568811.640.01728GRS
39GRS-ABC01565410.070.000413GRS
40GRS-ABC01562112.580.0054GRS
41ABC015711128.10.2754GRS
42ABC015715128.10.2754GRS
43ABC01570128.10.2754GRS
44ABC0209060630.86688XCF
45ABC0209479604561.65957XCF
46ABC02092860133.20.41496XCF
47ABC020933660196.440.814275XCF
48ABC020909619.20.058205XCF
49ABC02099796119.4240.576576XCF
Sheet1
Cell Formulas
RangeFormula
K5:K8K5=SUMIFS(Table4[times],Table4[staff],"*"&$I5,Table4[data_source],"GRS")
L5:L8L5=SUMIFS(Table4[PCS],Table4[staff],"*"&$I5,Table4[data_source],"GRS")
M5:M8M5=SUMIFS(Table4[weight],Table4[staff],"*"&$I5,Table4[data_source],"GRS")
N5:N8N5=SUMIFS(Table4[volume],Table4[staff],"*"&$I5,Table4[data_source],"GRS")
O5:O8O5=IFERROR(L5/(K5/3600),"")
 
Upvote 0
Exactly why I wanted the expected results as there is no language issue then. ;)


As far as I can see, formulas of the form you showed in post #3 produce those expected results. Here is my sheet with those formulas (slightly adjusted for different row numbers)

BTW, why does the table in columns B:G have two identical header rows?
[/RANGE]
It has that row only because it was copy paste data format in to the pre-created Table what was made earlier, and is easier to do ctrl+a copy paste then select those data :P

now with this formula =SUMIFS(Table4[times],Table4[staff],"*"&$I5,Table4[data_source],"GRS")
there is issue when the i5 cell is empty it will shows some value.... is not there some way how to use in this function OR? I tried IF but it will brings results as array with split error.
When i use instead o f "*" "GRS-" then it will not show values for names where there is no GRS- prefix.
Is there any substitute for OR in this formula same as & is for AND ?
when i use =SUMIFS(Table4[times],Table4[staff],"*"&$I5,Table4[data_source],"GRS",I5,"<>" ) it shows Value error
 
Upvote 0
now with this formula =SUMIFS(Table4[times],Table4[staff],"*"&$I5,Table4[data_source],"GRS")
there is issue when the i5 cell is empty it will shows some value.
Couldn't you just check for an empty cell first like this?

nahaku 2020-04-18 2.xlsm
BCDEFGHIJKLMNO
1
2How it should look
3stafftimesPCSweightvolumedata_sourcePutawayTime on Diff depGRS
4stafftimesPCSweightvolumedata_sourceTimePcsWeightVolumePCs / Hour
5GRS-ABC01560637.020.584496GRS0     
6GRS-ABC015620120.02457GRSABC008700000 
7GRS-ABC015615713.870.02312GRSABC020900000 
8GRS-ABC01561911.970.006732GRS     
9GRS-ABC01562113.320.023936GRSABC01560370945131.2941.4352643.67754112
10GRS-ABC01562313.10.02013GRS
11GRS-ABC0156126140.018444GRS
12GRS-ABC01562613.980.020163GRS
13GRS-ABC01562313.350.04959GRS
14GRS-ABC01562313.350.04959GRS
15GRS-ABC015659821.520.02125GRS
16GRS-ABC01562821.660.0084GRS
17GRS-ABC01562312.30.01248GRS
18GRS-ABC015621210.003888GRS
19GRS-ABC01562911.690.0074GRS
20GRS-ABC01562923.760.010962GRS
21GRS-ABC0156591130.078052GRS
22GRS-ABC01562411.80.025308GRS
23GRS-ABC015625412.030.05742GRS
24GRS-ABC01562210.30.001408GRS
25GRS-ABC01563114.360.01624GRS
26GRS-ABC015611714.460.123525GRS
27GRS-ABC015619115.390.075696GRS
28GRS-ABC01562610.2110.00156GRS
29GRS-ABC01561610.2670.00112GRS
30GRS-ABC01561510.650.009072GRS
31GRS-ABC015619010.970.00966GRS
32GRS-ABC01568611.8360.01728GRS
33GRS-ABC015694211.70.016105GRS
34GRS-ABC015612211.70.016105GRS
35GRS-ABC01563117.10.04508GRS
36GRS-ABC015621211.70.016105GRS
37GRS-ABC01564211.640.01728GRS
38GRS-ABC01568811.640.01728GRS
39GRS-ABC01565410.070.000413GRS
40GRS-ABC01562112.580.0054GRS
41ABC015711128.10.2754GRS
42ABC015715128.10.2754GRS
43ABC01570128.10.2754GRS
44ABC0209060630.86688XCF
45ABC0209479604561.65957XCF
46ABC02092860133.20.41496XCF
47ABC020933660196.440.814275XCF
48ABC020909619.20.058205XCF
49ABC02099796119.4240.576576XCF
Sheet1
Cell Formulas
RangeFormula
K5:K9K5=IF(I5="","",SUMIFS(Table4[times],Table4[staff],"*"&$I5,Table4[data_source],"GRS"))
L5:L9L5=IF(I5="","",SUMIFS(Table4[PCS],Table4[staff],"*"&$I5,Table4[data_source],"GRS"))
M5:M9M5=IF(I5="","",SUMIFS(Table4[weight],Table4[staff],"*"&$I5,Table4[data_source],"GRS"))
N5:N9N5=IF(I5="","",SUMIFS(Table4[volume],Table4[staff],"*"&$I5,Table4[data_source],"GRS"))
O5:O9O5=IFERROR(L5/(K5/3600),"")
 
Upvote 0

Forum statistics

Threads
1,215,460
Messages
6,124,949
Members
449,198
Latest member
MhammadishaqKhan

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