SUMIFS Excel Multi Criteria - excel

I'm trying to do use SUMIFS to calculate the total QTY changes for drawings with a material ID that Matches the Pipe Indent Numbers and ignore the ones that are NOT listed the piping indent numbers column. Below is what I have so far but I know the "=D:D" looks wrong.
I don't know how to reference all the numbers in the Pipe Indent Numbers List(D:) as each their own criteria, so that if the Material ID matches ANY of the Pipe Ident Numbers it will sum it.
I need help with this because my actual Pipe Ident Numbers column have about 100 other numbers not just the 5 shown.
Also not sure would I need to have the drawing number in the formula somewhere too? Maybe that's what I'm missing...
=SUMIFS(C:C,B:B,"=D:D")
Any help would be amazing! Thanks :)

you can use
if you want to compare row by row
=SUMPRODUCT(c2:c6*(b2:b6=d2:d6))
if you want to compare the value in column b with all values in column d (of you do not use Excel 365 press CTRL+SHIFT+ENTER to enter the formular)
=SUMPRODUCT(c2:c6*(b2:b6=TRANSPOSE(d2:d6)))
Best Regards
Chris

Use:
=SUMPRODUCT(SUMIFS(C:C,B:B,D2:D6))
One can use D:D but that would do many unneeded calculations. One should limit the range to the dataset.

Related

Excel Sumifs searching first 8 characters of a column

Good evening all,
I want to do a sumifs() but the two columns do not always have the exact same values. However, the first 8 characters would always match in both columns. For example the value I wish to look up is "00123456 - Nice Salad". The data I wish to search in sits in Column A with value to return in Column B.
I know I can use the left() function on the value to lookup but I am unsure how best to search against just the first 8 characters in column A. I would like the formula to return the number 6 from column B in this example.
Current formula is as follows: =sumifs(left(00123456 - Nice Salad,8),A:A,B:B)
I hope this all makes sense and any help is appreciated.
Many thanks, Alan.
Screenshot/this sheet refer:
One way is with a regular sum equation:
=SUM(1*(LEFT(A2:A4,8)=E2)*(B2:B4))
However, this can be computationally intensive (i.e. if you have plenty of data/rows to evaluate). The better, in my view, is simply a sumifs with wildcard '*', i.e.:
=SUMIFS(B2:B4,A2:A4,E2&"*")

Excel: Find matching row with numerical range

I have a spreadsheet with Company Name and Serial Number columns. The serial number column values are in range e.g. 1001-2000. How do I look up company name from a specific serial number value? See this screenshot for example.
Column B can be split into two columns if needed though it is preferable to have single column.
I tried this example but got a #Spill! error
Or, using Lookup+Imreal function
In E2, enter formula:
=LOOKUP(D2,IMREAL(B2:B5&"i"),A2:A5)
Be careful with this... It is a crude hack.
=IF(D2<=1000,A2,INDEX(A:A,MATCH(D2+1&"-"&D2,B:B,1)))
in the special case of the ranges all ending at a multiple of 1000 and each band being essentially 1000 units you could go with the special case formula of
=INDEX($A$2:$A$5,INT(($D2-1)/1000)+1)
Note that you don't actually use the info in column B for this option. It is based purely on the pattern to the range breakdown
if you want to restrict it to values between 1 and 4000 you could wrap it in an if statement that checks for that.
=IF(AND(D2>=1,D2<=4000),INDEX($A$2:$A$5,INT(($D2-1)/1000)+1),"SN out of range")

What is the most optimal way to use ArrayFormula() to Count non-Blanks Where Column Header Matches Row Value?

What I'm attempting to do is count the number of blank cells across a dataset where the header of the row matches an array.
=countifs(D1:AZ,D2:AZ,D1:1,A2)
However, it appears that since the array sizes are different, it can't use it as a lookup.
Ideally, I'd be able to get an array formula to count the number of non-blank cells that correspond to each date in A2:A, like this:
Looking at the documentation for COUNTIFS, I don't see anything about it not being able to handle vertical and horizontal matching.
Also, I need to avoid using =query(), since there may be instances in D1:1 where a date is missing. I will be handling that with an iferror().
Any help/advice you all could provide would be greatly appreciated!
I have made an editable copy of the dataset here for reference.
Thanks
Try this. It is a matrix multiplication formula that sums up the nonblank cells for each column. It should work for you.
=arrayformula(mmult(transpose(if(D1:1="",0,if(isblank(D2:BG),0,1))),sign(ROW(D2:BG))))
I can explain it if you are interested.
EDIT: How about this? It adds a vlookup.
=arrayformula(iferror(vlookup(A2:A,{transpose(D1:1),mmult(transpose(if(D1:1="",0,if(isblank(D2:BF),0,1))),sign(ROW(D2:BF)))},2,false)))
This may be a way to do it, on B2:
=COUNTIFS(OFFSET($D$2:$D,,MATCH(A2,$D$1:$AZ$1,0)-1),">0")
Then you auto fill down, the idea is:
MATCH(A2,$D$1:$AZ$1,0) Will match each date on column A to the date on row 1 and return an index (from 1 to N).
OFFSET($D$2:$D,,N) Will take the range D2:D and offset N columns (In this case the output of MATCH).
Finally COUNTIFS will look for >0 values in the column which header matches the date on the left.
I hope it helps

Count values after specific pattern in column occurs

My problem explained in Excel
Column A1:A22 have some binary numbers (0, 1). As you can see I highlighted numbers with GREEN fill color that match my pattern I want to find.
Column C5:C22 have formula as you can see in formula box, that CONCATENATE first four numbers ( A1:A4, A2:A5 etc..) in data set and check if it matches my pattern.
If this first four numbers match my pattern, I want Excel to count all NEXT numbers that are right after this pattern.
The biggest problem is that I can't do this this way because I have data set that have approximately 30.000 binary records in it, and my RAM memory can't handle that much of CONCANTENATE formula to count all NEXT values, after my pattern occurs.
I want someone to help me find other way without making HELPER columns, I want Excel formula, that in steps:
Search for pattern in data set..
IF pattern in data set matches my desired pattern, make AVERAGE of all values right after pattern occurs. So in example above my AVERAGE in cells C5:C22 = 0,66
I hope that I explain this in details so you know my problem, I need formula to do all the math stuff, I can't use helper columns like in example above.
Thanks in advance.
Concatenate once then Substitute Pattern to find
You can use CONCATENATE function in one cell, getting all the 1's and 0's into one cell.
Then SUBSTITUTE the Pattern to find with empty string "".
Then count how many Patterns were "Substitued" (Matched).
Like so:
Formulas in cells
D5-Concat all: =CONCAT(A1:A22)
E5-Len all: =LEN(D5)
F5-Substitute: =SUBSTITUTE(D5;Pattern;"")
G5-Len after: =LEN(F5)
H5-Matches: =(E5-G5)/PatternLen
To get it into one cell:
=(LEN(CONCAT(A1:A22))-LEN(SUBSTITUTE(CONCAT(A1:A22);Pattern;"")))/PatternLen

Comparing two columns in excel for similarities

I have two columns in excel A and B from 1 - 1400
The value in column A is 10 characters, "K0123456789" and column B is 9 characters "0123456789"
I need to compare the value in column B is the same value as column A without the "k" and highlight it if they do not match. I am not familiar with excel too much, so any information here would help so I do not have to go through all these lines myself on a daily basis.
Thanks for any help!
GenZade
You can put a formula in column C such as (For cell C1):
=IF(A1="K"&B1,"Match","No Match")
Of course, you could also add conditional formatting with a similar formula if you want to literally highlight it.
i would have just commented on neelsg post, but i don't have enough reputation for that, apologies. his solution works based on string values rather than numerical values. Some kind of preceding zeros might not work nicely with it. to compare actual numerical values you can use the following:
=IF(RIGHT(A1,LEN(A1)-1)*1=B1,"match","no match")
so depends if you want to match them as strings or actual numbers

Resources