Compare two columns in same sheet and find difference - excel

Hi I have an excel sheet with two columns- A and B. Each column has similar data and B has more data than A. How can I spot data which are available in B but not present in A?
A 12 13 14 15 and
B 12 123 13 14 145 15 16

Use CountIf() or Vlookup(). Put in cell C2 this formula =countif(A:A,B2) and copy it down. You'll see 0 when they are unique.

Related

Which is better to use for referencing single cells in excel: A1 or A:A / 1:1?

Is there a difference when using a cell reference and column / row reference when pointing to a single cell? Or is there a better way? Sample table below.
I have been using column / row reference for faster checking of formulas, using Show Formulas, but I do not know if it has an impact to memory and processing times for very large files.
Sample table (A/B or C/D?):
R\C A B C D
1 25 18 13 21
2 14 19 22 17
4 =A1+A2 =B1+B2 =1:1+2:2 =1:1+2:2
6 =A4 =B4 =4:4 =4:4
Thanks.

Match row and column to get the value from the same row - Matrix

I have a matrix like below,
A B C D E F
A 0 12 13 14 15 16
B 12 0 12 15 15 18
C 11 11 0 12 12 15
D 26 24 25 0 22 25
E 87 86 82 12 0 23
F 11 25 36 14 25 0
Now i want that in the below format,
A A 0
A B 12
A C 13
A D 14
A E 15
A F 16
B A 12
B B 0
B C 12 so on.
How can i achive that in excel via formulae.
As stated Offset is a volatile function in that it will always calculate whenever excel calculates regardless if the underlying data has changed or not.
Index is not volatile:
In A10:
=INDEX($A$2:$A$7,INT((ROW(1:1)-1)/ROWS($A$2:$A$7))+1)
In B10:
=INDEX($B$1:$G$1,MOD((ROW(1:1)-1),COLUMNS($B$1:$G$1))+1)
In C10:
=INDEX(A:G,MATCH(A10,$A:$A,0),MATCH(B10,$1:$1,0))
Then copy down
Assuming your data is fixed width (6 here) and exists in columns A-F. Put the following formulas in J1-L1 and fill down. It uses the offset method and looks at fractions of the row, either the remainder or the integer to determine steps for rows (integer) or remainder via mod function (columns).
=OFFSET($A$1,ROUNDDOWN((ROW(J1)-ROW($J$1))/6,0)+1,0)
=OFFSET($A$1,0,MOD((ROW(K1)-ROW($J$1)),6)+1)
=OFFSET($A$1,ROUNDDOWN((ROW(L1)-ROW($J$1))/6,0)+1,MOD((ROW(K1)-ROW($J$1)),6)+1)
I'm hoping I understand your question. But, assuming you had your matrix starting in the top left of the sheet, you would have:
Going Down:
"A" in cell A2, "B" in cell B2, etc
Going Across:
"A" in cell B1, "B" in cell C1, etc
Data:
Your first value (corresponding to A,A) in cell B2
So, now you havem for example, in cell A10 the row letter you want and, in cell A11 the column letter you want. So, you could use the following formula to get your desired result:
=INDEX($B$2:$G$7,MATCH(A10,$A$2:$A$7,0),MATCH(B10,$B$1:$G$1,0))
Basically, using the INDEX() function on your array and matching the row to the desired row letter and the column to your desired column letter.
Hope that makes sense.

How to look up for multiple values and convert them in to a horizontal table in excel

I have a table like below in excel spread sheet
A 1
A 2
B 12
B 4
B 56
B 68
C 7
C 8
C 34
D 10
D 11
i need to convert the table as below
First entry Second entry Third entry Fourth entry
A 1 2 - -
B 12 4 56 68
C 7 8 34
D 10 11
Provided your list of letters (assumed to be in ColumnA starting in Row1) is sorted and you have a separate list of just one each of those letters (say starting in D1) then a formula may achieve the results you want:
=IF(COUNTIF($A:$A,$D1)>COLUMN()-5,OFFSET(INDEX($A:$A,MATCH($D1,$A:$A,0)),COLUMN()-5,1),"")
In F1, copied down to suit and then all formulae copied across until an entire column is blank.

Partial Sums from a Given Column

I was wondering if there is a quick way to have Excel sum up chunks of a selected column based on where blanks appear in that column. For example, the column might look like:
10
12
15
11
2
3
10
13
14
14
13
1
9
8
6
and ideally each partial total would be placed where the first element being summed was previously. Can this be done without VBA?
Leave B1 empty, In B2 enter:
=IF(A2<>"","",SUM($A$1:A2)-SUM($B$1:B1))
and copy down............should look like:

Excel table : how can I change row and column?

I have a table excel with one column and X rows.
4 various informations
example:
row 1 2 3 4 = informations for 1
row 5 6 7 8 = information for 2
I would like to know how can I do to have these information by row instead of by column?
Example:
paul
madrid
14
victor
canada
23
emilie
paris
18
and I Would like:
paul Victor Emilie
Madrid Canada Paris
14 23 18
If you want change data only once, use Copy/Paste
Switch (transpose) columns and rows
Or if you want use formula
TRANSPOSE function
Or you can use the INDIRECT function instead. It's a bit tricky but it works :
On the same sheet where you have :
Paul
Madrid
23
Victor
Montréal
22
Aude
Copenhague
17
Valérie
Alger
28
Add something like (for example on columns B, C, D) :
1 2 3
4 5 6
7 8 9
10 11 12
etc.
It's easy to do with =X+3 formula and drag down formula.
Then, this matrix represent the position of each element in the list, you now just have to use INDIRECT in this way :
=INDIRECT("A" & B1)
A is the column where are your data
B1 is the position of the first element in the matrix
By draging this formula down and on the right, you will the matrix with the A's elements.
(Using example where source column in G2:G100 and target table in H2:J34.)
Type formula below in first cell of target table (H2):
=OFFSET($G$2;(ROW()-ROW($2:$2))*3+COLUMN()-COLUMN($H:$H);0)
Replacing $G$2 with first cell of source data, $2:$2 with first row of target table and $H:$H with first column of target table (mind the $).
Then just drag formula left and then bottom.

Resources