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.
Related
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.
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
My first post on here. I am looking for help on a problem I have encountered at work. I need a cell to recognize the name of a tab/worksheet from another cell, and pull up a value from that worksheet. FOr example, the sheet's name is 'Destination', I want something that goes to that work sheet and pull up the value in cell C1. The value will be in the same cell in every tab, so in this example, it will always be in C1. Ideally, I'd like a formula as I have never used VBA but if there is no way around it, I'd appreciate a simple VBA code as well.
I would like to copy this formula to multiple cells in the same column, where the name of the tab changes but the cell location does not.
Thanks for your help.
If you want to use a formula, use the INDIRECT formula. As an example, cell A1 contains the word destination. The below formula will pull information from the Destination Worksheet, Cell C1.
=INDIRECT(A1&"!C1")
Let me know if that helps.
My case is little different I am working on an excel sheet so far It was a success but now I am totally clue less, what I am trying to do is I have two sheets
sheet1
sheet2
In sheet1 I am calling data from sheet2 suppose
in sheet1 a5 I am calling data from sheet2 c3 by this formula
=sheet2!c3
What I want to do is when I put a blank new row or column in sheet2 it automatically change the formula accordingly And I don't want it to do so, like it change it from
=sheet2!c3 into =sheet2!c4
I also tried putting $
=sheet2!$c$3
But it seems it only works on the same sheet not if you are calling data from another sheet, is there any way I can make this formula constant not change but remaining =Sheet2!c3 ??
That's how Excel works when you insert rows I am afraid. You could try building the formula as a string value:
=INDIRECT("sheet2!C3",TRUE)
I just used the index function
=index(sheet2!c3,c,3)
and it works !
The above method is also 100%percent working and accurate.
I am working with 2 sheets in a single spreadsheet and I want to link the items of cells of first sheet to the cells of second sheet so that when I make any change in a cell in one of the sheets the same change should take place in another sheet in its linked cell.
I followed what is being suggested here Linking cells in same Excel spreadsheet but it didn't work. Thank you.
If the sheet you are making changes to is Sheet2, in sheet1 just use something like =Sheet2!A1 and the cell will directly show whatever is in the cell A1 in sheet2, etc.
If both sheets need hard coded values then you'll need to do something more complicated, like an event in VBA.