Comparing two columns in excel for similarities - excel

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

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&"*")

SUMIFS Excel Multi Criteria

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.

How can I add a comma & space after every two digits in Excel and then format the text?

Here's the table I'm working with:
First off, how can I separate the string of numbers in column C so that they have a comma and space after every two digits?
I was able to partially finish it, but for some reason I can't grab the last two digits. I used this formula:
=MID(C4,1,2)&", "&MID(C4,3,2)&", "&MID(C4,6,2)&", "&MID(C4,10,2)&", "&MID(C4,13,2)&", "&MID(C4,16,2)
After that I need to somehow format that string to look like the example in column E, that's where I'm really confused. Maybe I don't even need the first step?
Any help is appreciated. Thanks
If you already have access to TEXTJOIN formula then it will quickly become your best friend :-)
I assume that your values are in column C (starting from cell C1) and that the column is formatted as text.
Try:
="""stats"":["&TEXTJOIN(", ",TRUE,MID(C1,ROW($A$1:INDEX(A:A,LEN(C1)/2))*2-1,2))&"]"
If your Office 365 version is not using dynamic arrays yet, try entering the formula with Ctrl+Shift+Enter:

Find Duplicates in a column with large number (as text)

I have a SpreadSheet with a column with large number represented as text, and when I apply the duplicate operation to check ( I do not use any formula, I am using excel 2010 in-built functionality of "Conditional Formatting" -->"Highlight Cells Rule" --> "Duplicate Values") even distinct values are shown as duplicate values.
For example:
If I just have following values in a column of spread sheet:
26200008004000800000000000000001
26200008004000800000000000000002
26200008004000800000000000000003
It shows as all 3 values being duplicate.
How do I fix this and check for duplicates with these large numbers in excel.
P.S: I know excel has a 15 digit limit to precision, but is there a work around or another application to find duplicates.
It seems that DupUnique property is converting the value to a number. I also note similar behavior with COUNTIF. Accordingly, I would suggest, in this situation, that you use the conditional format option to use a formula. The formula I would suggest (assuming that the range to check for duplicates is A2:A10, would be:
=SUMPRODUCT(--($A2=$A$2:$A$10))>1
I use a helper column in which I concatenate the number with a letter to make it an alphanumeric entry.
=concatenate("a",'large number cell')
or
="a"&'large number cell'
a26200008004000800000000000000001
I hope this works for you.
When pasting the numbers into Excel, put an apostrophe in front of the number to convert the number to text like this
'26200008004000800000000000000001
Thereafter you can do duplicate checks using Data -> Remove Duplicates.
If you already have that kind of data in Excel, it may appear in Exponential values and chances are that Excel chomped it up to 15 digits numeric precision. You may have to re-enter the large data with apostrophe in front of them.

Returning a value if three columns match in excel

I have two excel sheets where I need to match three values to return a fourth. The similar columns are month, agent, and subdomain. The fourth column is called difference.
Concatenate would work, as per #MakeCents suggestion, but if you don't want a helper column, SUMPRODUCT would work.
example:
=SUMPRODUCT(--(A2:A12="d"),--(B2:B12="S"),--(C2:C12="Apr"),D2:D12)
would search range A2:A12 for "d", B2:B12 for "S" and C2:C12 for "Apr", and return the value fom D2:D12 that corresponds to where all 3 are true. If multiple lines match, it will add the value in D2:D12 for all matching rows.
The -- is used to change the True/False results into 0 and 1 for use in multiplication
Limitations of SUMPRODUCT
Recommended to specify the range explicitly; it will be slower with just
column references
(A1:A4000 is ok, A:A is not)
It will return an error if any of the values are errors
It will return numeric results only - text is evaluated as Zero
Although I believe #MakeCents comment / suggestion on how to do this is the way I would go since it is the simplest, you could accomplish this a different way (MUCH more processor-intensive, though) using the Index() and Match() functions and Array formulas.
For example, suppose your 3 columns of data you're looking to match against are columns A-C and you're looking to return the matching value from column D in Sheet1
Now, the 3 values you're looking to have matched are in cells A1, B1 & C1 of Sheet2, you could use the following formula:
=INDEX(Sheet1!D:D,MATCH(1,(Sheet1!A:A=A1)*(Sheet1!B:B=B1)*(Sheet1!C:C=C1),0))
And ENTER IT AS AN ARRAY FORMULA by pressing Ctrl + Shift + Enter
Hope this helps!
You are looking for a Lookup with multiple criteria.
One of the most robust options is
=INDEX(D:D,SUMPRODUCT(--(A:A="d"),--(B:B="S"),--(C:C="Apr"),ROW(D:D)),0)
It does not need to be entered as an array formula.
Taken from [1] (blogs.office.com).
See also this very complete answer, which summarizes this and other options for performing a lookup with multiple criteria.
PS1: Note that I used references to full columns, as per this.
PS2: This can be considered an enhancement to the solution by Sean for the case when the output column does not contain numbers.
References
[1] This post is written by JP Pinto, the winner of the Great White Shark Award given for the best article written about VLOOKUP during VLOOKUP Week.
Try this
=IF(A4=Data!$A$4:$A$741,IF(B4=Data!$B$4:$B$741,"Hai"))

Resources