Identify Rows with Same Values in 2 Different Columns - excel

I have a data set of roughly 405,000 rows and 23 columns. I need the records where the value in column "D" is the same as the value in column "H" for that row.
So for
A B C D E F G H
13 8 21 ok 3 S - of
51 7 22 no 3 A k no
24 3 23 by 3 S * we
24 4 24 we 3 S ! ok
24 9 25 by 3 S # we
75 2 26 ok 3 S 9 ok
etc...
I'd get back the 2nd row, the 6th row, etc...
A B C D E F G H
51 7 22 no 3 A k no
75 2 26 ok 3 S 9 ok
Based on other posts like: Formula to find matching row value based on cells in multiple columns I tried using a Pivot Table, but it complains I can't put either of my two columns in the "Columns" area because there is too much data. With both columns in the "Rows" area, I get a relationship of D to H, but I can't then find a way to filter on only those where D = H.
I've also looked into countifs(), vlookup, and index / match functions, but I can't figure this out. Help please.

I would do a simple "IF()" formula in a new column.
For your example add a new column I and use the following formula in the first data row (I2):
=IF(D2=H2,"Yes","No")
Fill down to the end of the data.
Then using Excel filters or countif you can check the number of "Yes" vs "No" in your data.

Related

Formula reference holds for n cells in a row, then switches to new reference

I wonder if there's a quick solution to the following:
My goal is to divide a cell value by three, using the same value for three cells in a row, then switch to the next value in the series for another three cells in a row, and so on.
So my starting data would look like:
A B C D E
1 9 12 6 21 27
2 30 9 3 0 3
3 ...
I want the new cells to look like:
AA AB AC AD AE ...
1 3 3 3 4 4
2 10 10 10 3 3
...
Where the cell AA1 = A1/3, AB1 = A1/3, AC1 = A1/3, but AD1 = B1/3 and so on.
I need to do this for many observations, preferably using an excel formula.
Does anyone have any ideas on quick solutions?
Really appreciate your help.
Best,
Henry
Use INDEX:
=INDEX(1:1,0,ROUNDUP(COLUMN(A1)/3,0))/3

Sumif of multiple Index matches against one value

Need help regarding Excel dynamically search based sum of two columns matching from two different tables.
I have got this Table of Data Entered One Time
A B C
1 Qlty Warp Weft
2 Stpl.1 150 20
3 Cotn.1 80 60
4 Stpl.2 20 20
5 Cotn.2 20 20
6 Stpl.3 20 40
in Column A2:A6, Quality can not be duplicated, its a unique Name
The Data entry and report Table is here
A B C D E F
8 Yarn Name Sent Bags Remaining Qualty Used Warp Used Weft
9 20 800 600 Stpl.1 71 200
10 150 101 30 Stpl.2 70 30
11 40 300 290 Stpl.3 100 10
12 20 400
C9:C5000 is Returning Column, Values are calculated on the base of Column A9:A5000 (Yarn Name)
Need to Find Yarn Name (eg:) "20" in B2:B6 AND/OR C2:C6, wherever it matches, index that Quality from A2:A6
Then match the returned qualities(could be more than one) to D9:D5000 and sum the mathced results from E9:F5000
I have tried so far in C12
=SUMIF($A$9:$A12,A12,$B$9:$B12)-(SUMIF($D$9:$D12,INDEX($A$2:$A$6,MATCH(A12,$B$2:$B$6,0)),$D$9:$D12)+SUMIF($D$9:$D12,INDEX($A$2:$A$6,MATCH(A12,$C$2:$C$6,0)),$D$9:$D12))
PS:- I am using Excel 2007
If I understand correctly, then following array formula can help you:
=SUM(IFERROR(INDEX($A$2:$A$6,N(IF(1,(MMULT(--($B$2:$C$6=A9),TRANSPOSE(COLUMN($B$2:$C$6)^0))>0)*(ROW($B$2:$C$6))-1)))=TRANSPOSE($D$9:$D$12),0)*TRANSPOSE($E$9:$E$12+$F$9:$F$12))
Array formula after editing is confirmed by pressing ctrl + shift + enter
Edit:
To calculate Warp and Weft columns separately use following array formula:
=SUM(IFERROR(INDEX($A$2:$A$6,N(IF(1,((A9=$B$2:$B$6)*ROW($B$2:$B$6))-1)))=TRANSPOSE($D$9:$D$12),0)*TRANSPOSE($E$9:$E$12))+SUM(IFERROR(INDEX($A$2:$A$6,N(IF(1,((A9=$C$2:$C$6)*ROW($C$2:$C$6))-1)))=TRANSPOSE($D$9:$D$12),0)*TRANSPOSE($F$9:$F$12))

Analysing data using the column name

I have the following data.
Z Y Z Z
A1 A2 A3 A4 Total
1 2 5 10 16
2 3 5 11 18
3 4 6 12 21
4 4 7 12 23
I want to sum the rows using Just Zs ( the name of columns). I have a big data set, so I want to write a function to find out Zs in the whole sheet and the then sum them (Total).
Any Help would be appreciated
This can be done with SUMIF():
=SUMIF($1:$1,"Z",2:2)
NOTE
With the above formula it is using full row references so DO NOT put "Z" on top of the total column or it will throw circular errors.
If you want to have "Z" above it then you need to define the ranges:
=SUMIF(A$1:D$1,"Z",A2:D2)
How does this work:
=Sum(If(A$1:D$1="Z",$A$2:$D$100))
Assuming your headers are in row 1, columns A to D, and your data starts in row 2, and goes to row 100.

Excel Comparing Multiple Columns

I have a spread sheet that has computers in the furthest left column with their specs in columns B - L. There are a lot of extraneous computers in this list I don't need to work on, so I wrote a little Python script to pull out the bad values from the computer list (what was in column A). I then inserted a column to the left of column A (so what was in A is now in B and the good values are in A). I basically need to keep column A as it is, make column B match it and also remove the corresponding specs of the computers I don't need to worry about, but keep everything sorted so I know what specs go with what computer I need to work. Is there any way to do this in Excel?
thanks
Vlookup should do the trick
Assuming the current source data looks like this:
A A 1 2 3 5 6
D B 7 8 9 10 11
F C 12 13 14 15 16
D 17 18 19 20 21
E 22 23 24 25 26
F 27 28 29 30 31
G 32 33 34 35 36
and desired output is this
A 1 2 3 5 6
D 17 18 19 20 21
F 27 28 29 30 31
On a new sheet to keep it clean
Assuming SHeet1 has your current data
in Sheet2 column a Sheet4!A1
in Sheet2 column B VLOOKUP(Sheet4!B1,Sheet4!$B$1:$G$7,2,0)
VLOOKUP(Sheet4!B1,Sheet4!$B$1:$G$7,3,0) for column C and etc
dirty and tedious, but should work.
I think you should try adding data into columnA (new) based on whether the (new) columnB values feature in the good list (elsewhere), say with MATCH. If they do not #N/A should be returned and that might be used to filter on and delete what is visible.
If your 'good' list is in Sheet2 column C you might try:
=MATCH(B1,Sheet2!C:C,0)
copied down to suit.

How to add up values in Excel while ignoring missing values (encoded 999)?

Please consider the following Excel worksheet:
A B C D E F
---------------------------
1 10 5 999 999 10 25
2 5 1 10 999 5 21
3 5 1 100 1 5 112
What I need is a formula in each cell of column Fto add up the values of each row, whilst ignoring 999 values. So usually the formula in cell F1 would be:
=SUM(A1:F1)
But this obviously returns 2048, not 25. So my question: what formula will add up all values, ignoring 999 (missing) values?
Extending from comment (and thanks to #SiddharthRout):
You can use
=SUMIF(A1:E1,"<>999")
in column F.

Resources