Excel - matching 2 cells from one sheet in another - excel

I am trying to work out a formula that says if one cell in a sheet, and another cell in the same sheet match the same names of cells in a different sheet, then the answer is a cell between those sheets.
I've tried MATCH and INDEX but can't seem to get it to work. Is anyone able to assist?
Cheers

Related

Match check cells from two sheets to match then copy column to another sheet

I am puzzled how to achieve the following items in Excel VBA. I saw a lot of tutorials but everyone is talking about move the entire row of a pre-defined text/number in the VBA, which isn't what I hoped to do.
My objective is to:
first, I need to use ID cell on Sheet1 as a master, I need to compare each of those ID cells with entire column of ID cells on Sheet2 to find a match repeatedly
If there is a match, copy a selective number of columns on the same row of ID cell (that matched with Sheet1's ID cell) on the Sheet2 to Sheet1 next to Sheet1's ID cell, then the process repeated for all ID cells
Vlookup can only do it for the first cells, but because there are many cells with cell value but the content on the selective column I am trying to copy to the Sheet1 from Sheet2 is different.
Please help for come up ideas how to achieve it on VBA. Thanks.

Fill data in excel sheet from master list from another sheet

I have data in two separate excel sheet in single file.
In the first sheet, I have two columns...like this
Sheet1
In the second sheet, I have one of the column which is same as Name in Sheet1. However, it does not have second column where I want to bring the value referring to the sheet 1.
Here is the second sheet.
Here in second column, i.e. Color I want to bring the value from first sheet.
I am using Libreoffice but can use excel as well. Pls suggest how I would do this in excel / libreoffice.
Solution for Excel...
So use sheet one as the reference sheet. Sheet two as the one you want to fill.
In B2 on Sheet 2 enter this formula:
=vlookup(A2,Sheet1!$A$1:B$6$,2,FAlSE)
Then drag down.
This is assuming that your reference in sheet one is in columns A and B and goes from rows 1 to 6.
Hope this helps.
One of the easier ways to do this would be to use VLOOKUP. So this requires 4 inputs:
The value you are searching for
The array you are searching in
The column where the value you want to return is in
"FALSE" to list if you want an exact match between the value you are searching for and the array you are searching in.
So in your example, we will use the worksheet where you only have the Names listed as the worksheet you are putting the formula, so something like this in B2:
=VLOOKUP(A2,sheet2!$A$2:$B$6,2,FALSE)
So this would lookup the value you show in worksheet 1 cell A2.
Then go to workbook 2 and match that value with what is in A2:A6.
Then lookup what is in column 2 for your answer.
And return what is in column 2 only if worksheet 1 cell A2 and something in worksheet 2 range A2:A6 is an exact match.
There are other ways, but for your example, this should be easiest in EXCEL. This only works if the value you are searching for is to the right of the value you are looking up. If you need to go to the left, INDEX/MATCH would be better (but not required here).
Hope this helps!
JW

Referencing cells to specify sheet range

My workbook contains a summary sheet which summarises the data held in the other sheets. My current formula in the summary sheet in cell C6 adds up cell B7 in all of the other sheets, RKW3455 being the first sheet to include in the calculation and Batch_20 bring the last sheet to include.
=SUM('RKW3455:Batch_20'!B7)
It works fine but the tab names will change and so to avoid having to change the sheet name within the formula I wanted to put the first sheet name into J2 and the last sheet name into J3. Then I wanted to reference those cells in the formula which will just make it easier to amend when there are new sheets. I can't get it to work though. This is what I have:
=SUM(INDIRECT("'"&J2):INDIRECT(J3&"'"&"!")B7)
I've also tried
=SUM(INDIRECT("'"&J2):INDIRECT(J3&"'")!B7)
Can anyone correct where I'm going wrong please?
Thanks
Used a workaround as suggested by Jeeped and Darren Bartrup-Cook in the comments. Created a 'start' sheet and an 'end' sheet to sum the sheets in between.

reference same cell from multiple sheets

I am trying desperately to use the INDIRECT function to pull the values from the same cell on multiple worksheets but all I keep getting is #REF. I have all the sheet names in column I. I tried =INDIRECT(I2&"A1") with I2 being the cell with the sheet name and A1 being the cell on that sheet I want to pull the data for. I'm not sure what's going wrong....
You need an exlamation mark.
Try =INDIRECT(I2&"!"&"A1")
It works for me.

Prevent #ref when cell deleted

I'm importing a text file into one sheet, eliminating un-needed lines, while formatting the data on the second sheet.
I have all the formulas on the second sheet set up, referencing cells on the first sheet.
The problem is that after deleting the un-needed lines and the data moves up, the formulas for the deleted lines say #ref. I want the formulas to use, say Sheet1!B2 no matter what data is there.
I see that Indirect works, so the next question is, how can I copy the Indirect function down a colum of 500 rows with each one having the right reference?
Thanks
I had this same problem recently so just passing along the answer I got. Index functions will help. Below you can see one where the sheet name is reference in cell a1 and it will return the value in cell a2 of the corresponding sheet.
=INDEX(INDIRECT($A1&"!2:2"),COLUMN(A:A))
If you only need to reference cells on the same row, including cells on different sheets on the same row, there's an easier way than Indirect.
If you write in A42:
=#B:B
it will look up B42.
If you write in A42:
='Sheet 2'!#X:X
It will look up X42 on Sheet 2.
If you delete the top rows on Sheet 2, the formula on Sheet 1 will point to the new X42 - no #REF! errors.
As long as your formulas in Sheet 1 just need to reference cells on the same row in Sheet 2 - so the formula in 'Sheet 1'!A42 might want 'Sheet 2'!X42 but not 'Sheet 2'!X43 - you can just put the column names as inputs into the formula. Otherwise you'll need Indirect.
For bonus points, name the columns in Sheet 2, so instead of ='Sheet 2'!#X:X you could write =cust_DateOfBirth for example.

Resources