Vllookup, match, index - excel

I am trying to compare data from one sheet to another. Address and its ID.
Both sheets have Address and ID. ID can be repetitive.
Sheet 1 Sheet 2
Address ID Address ID
23 1 22 1
45 1 45 1
23 2 23 2
45 2 45 3
I want to check whether the data address & ID on sheet 1 appear on Sheet 2 thus making a new row with return Yes or No on sheet 1 for every column.

This can be done very quickly with an array formula.
Picture of ranges and result shows the data on the same sheet so that it is easier to see what is going on. Pretend Sheet1 is on the left and Sheet2 is on the right.
Formula in cell D3 is an array formula (enter with CTRL+SHIFT+ENTER) and then copied down to fill.
=(B3=$F$3:$F$6)*(C3=$G$3:$G$6)
This formula will simple return a 0 or 1 for no match/match. You can wrap it in an IF if you want text instead. It is simply checking that the relevant values match for both columns in both "sheets".

Related

Is it possible to have IF formula delete a row?

I have a formula that right now pulls and outputs on another sheet whether the B1 Cell is equal to “YES” then print A1 in the new sheets Cell I have the formula entered in, if it is not then it leaves the cell blank and this goes on for as many cells as needed.
Here is my formula
=IF((Sheet1!B1)=“YES”,Sheet!1A1,””)
I am wondering if there is a way to change the formula to where if it is not equal to “YES” then instead of leaving the Cell blank it deletes the entire row instead.
I know the final ,””) part of the formula is what I used to state the Cell will be blank. I’m just unaware if there is a function or anything I can input instead to state if not “YES” then delete the Row.
Example of what is happening:
If I have these entries in Sheet 1
A
B
1
85
YES
2
47
NO
3
74
YES
The output on Sheet 2 using my formula will be:
A
B
1
85
2
3
74
I am looking for it to look like this:
A
B
1
85
2
74
3
Thanks!

Index match returning N/A when lookup value is null

I have a summary sheet in a workbook that allows a user to enter in a 3 digit ID and some summary data and a chart populates. In the source data, the ID for the totals row is blank. So, when the lookup value is blank (no 3 digit ID is entered) I expected the Index Match formula to return the values corresponding to a blank cell in the lookup array, but it doesn't. How can I fix this?
Sampling of the data:
ID March April
111 10 15
222 15 10
333 10 10
35 35
Formula used:
=INDEX(B9:B12,MATCH(A1,A9:A12,0))
Where A1 is the lookup value
Say we have data like:
and we want to enter the name in A1 and retrieve the age in B1 and also accommodate the blank in column E.
In B1 enter:
=IF(A1="",INDEX(F:F,MATCH(TRUE,INDEX(ISBLANK(E1:E30),0,0),0)),VLOOKUP(A1,E2:F21,2,FALSE))
You cannot lookup a blank cell. Use IFERROR to find the first blank with AGGREGATE in the target if you receive an #N/A.
=INDEX(B9:B12, iferror(MATCH(A1,A9:A12,0), aggregate(15, 6, row($1:$4)/not(len(A9:A12)), 1)))
row($1:$4) is the position within B9:B12 that you are returning to the INDEX.

Excel horizontal list to columns

I am looking to format some data. To make it more easy I use an example with simple numbers.
Sheet 1 ('S1'):
A1 10
A2 14
A3 23
A4 12
A5 64
A6 32
.... etc
It is a long list(vertical) of 600 values
Now I want in Sheet 2('S2'):
To show it as:
S1!A1 S1!A2 S1!A3 S1!A4 S1!A5 S1!A6
S1!A7 S1!A8 S1!A9 S1!A10 S1!A11 S1!A12
S1!A13 S1!A14 S1!A15 S1!A16 S1!A17 S1!A18
References to the cells in the other sheet.
I have tried to transpose them but I cannot find a modifier to set an amount of columns used. i.e. I would get 1 row with all my data. I want only the first 6 in row, next 6 in next row, next 6... etc.
Thanks for any help/feedback given.
Put this in the upper left cell desired:
=INDEX(Sheet1!$A:$A,(ROW(1:1)-1)*6+COLUMN(A:A))
Then copy/drag over 6 columns and down till you finish the list
Sheet1

Excel - Remove duplicates and SUM at the same time

I have a column with ID's, but they are duplicated; for instance:
"0,0,1,1,1,2,3,3,4,4, ... "
For each row, I have a given value in the other columns, for instance:
"0-24; 0-36; 1-13; 1-34; 1-23;..."
I want to keep only one row with each ID but I need to sum the values of each ID, that is, sum all the values in all columns for a given ID (0,1,2,...), which may include several rows.
Is there a easy way to do this using Excel?
Here is some sample data (table to the left) together with the desired output (tables to the right).
ID Value ID Value
0 24 0 60
0 36 1 70
1 13 2 16
1 34 3 24
1 23 4 48
2 16
3 9
3 15
4 24
4 24
What you can do is to copy your IDs and paste them for example in another Sheet. Let's assume your original table is in Sheet1, and you copy all your IDs to column A in Sheet2.
Then you remove duplicate IDs in Sheet2:
Select column A > Data Ribbon > Data Tools > Remove Duplicates
In column B, you then put the formula:
=SUMIF(Sheet1!$A:$A, Sheet2!$A2, Sheet1!$B:$B)
Note: above formula goes into cell B2 on Sheet2, and you copy it down with pasteSpecial > only formulas.
Edit: if you still want the same number of rows etc because of the information in your other columns, just skip the "Remove duplicates"-part.

MS Excel - Get multiple results based on same values in a column

Basically my problem is that I have an integer (1) in one cell in excel, and I want to show all the rows from an another worksheet, where the first column has the same integer (1).
Example of Worksheet 2
Slot Data1 Data2
1 15 124
2 20 23
1 89 523
3 20 23
Now I want to scan the Slot column for 1 and then populate the cells with the values under Data1.
I have tried to work with functions INDEX and MATCH, but the problem is it gives back only the first row where the Slot column has 1
My function is: =INDEX('Worksheet2'!DATA1:DATA1;(MATCH(1;'Worksheet2'!SLOT:SLOT)))
This function search in Worksheet 2's SLOT column for the integer 1 and gives back the value of DATA1 from the same row.
In this case we've got back 15 as result. The only problem is, this function only finds the first row with the value 1 in SLOT's column, but I want to get back all of the rows having 1 as SLOT.
How can I get 15 also 89 as result - maybe in another cell in Worksheet 1? Do I need to use VBA on this?
(I'm using Excel 2013)
You will have to transcribe this to your named ranges with worksheet scope.
=IFERROR(INDEX(DATA1, SMALL(INDEX(ROW(SLOT)+(SLOT<>1)*1E+99, , ), ROW(1:1))), "")
Fill down for the second, third, etc. matches.

Resources