Reference cells in another sheet using text in current sheet - excel

I need to get numbers from cells in other sheets. I am currently doing the following in Sheet 1 in cell D14 (but also in another 100 cells):
=('Sheet Two'!$AA$69*'Sheet Three'!AA$70)
This gets me the information I need. As it happens though I have a cell in Sheet 1 with the names of the sheets I need the information from.
I would like a formula that references the cells in Sheet 1 to get the names so I wouldn't have to manually type in the different sheet names for 100 cells.
So if say I have written in text:
Cell A1: Sheet two
Cell A2: Sheet Three
I need something like:
=(***Name in Cell A1***!$AA$69*'***Name In Cell A2***'!AA$70)

=INDIRECT(INDIRECT("A1")&"$AA$69")*INDIRECT(INDIRECT("A2")&"$AA$70") seems to be of the nature of what you are asking for (where A1 contains ''Sheet Two'! but it looks as though a different layout might be much more effective, or use of Search and Replace.

You could use the INDIRECT formula as pnuts suggested, but simpler like this:
=INDIRECT("'",A1&"'!AA$69")*INDIRECT("'"&A2&"'!AA$70")

Related

I have an excel file and I would like to know which formulas are repetitive and iterative... the links to these sheets are also all over the place

The excel file has 30+ sheets and formulas everywhere. I tried tallying the formulas but it's not giving me the results that I wanted since C2 in one sheet is not necessarily C2 in another, despite the formulas containing them being the same.
for example:
Sheet 1 has this on cell A1:
=IF($C$2 ="DOG",I19,SUMIFS($D$19:$E$19,$D$20:$E$20,$D$21:$E$21))
and Sheet 2 has this on cell A1:
=IF($C$2 ="DOG",I19,SUMIFS($D$19:$E$19,$D$20:$E$20,$D$21:$E$21))
since they are matching, i would want to know if their values are the same since the cells in the formula are the same.
TLDR I have a stock pricing model excel file that I think is too heavy. I would want to find redundant computations within the file.
The values will not be the same: the formulas contain cell references, but the mentioned cell references refer to the worksheet they are located in: the formula in sheet "Sheet1" refers to the cells in "Sheet1", while the formula in sheet "Sheet2" refers to the cells in "Sheet2".
In case you want the formula in "Sheet2" refer to the cells in "Sheet1", you need to mention this in the cell references, something like (not tested):
=IF(Sheet1!$C$2 ="DOG",Sheet1!I19,SUMIFS(Sheet1!$D$19:Sheet1!$E$19,Sheet1!$D$20:Sheet1!$E$20,Sheet1!$D$21:Sheet1!$E$21))

COUNTIFS with different-sized ranges / INDEX-MATCH and COUNTIF

Headline: I need to make a summary table that, for each row, looks to another sheet, finds the corresponding row based on a criteria (name), and counts the number of instances of a certain value ("P") across several columns.
Specifics:
I am making a summary "cover sheet" for an excel doc that summarizes information from other sheets. So, Sheet1 looks like this:
....and I want to fill in the "Attendance" column (B:B) on this sheet. I want it to do this by counting the number of P's in another sheet. Sheet2 looks like this:
(note that names are not in the same order as on Sheet1)
Desired outcome (which I hand-entered here):
IMPORTANTLY/Annoyingly: Because of some annoying rules & regulations, I'm not allowed to simply add a helper column to Sheet2 (E:E) (=countif(B2:D2,"P") that I'd then simply import in (=INDEX(Sheet2!E:E, MATCH(A2, Sheet2!A:A, 0)).
I've tried making a hybrid INDEX-COUNTIF & a hybrid COUNTIF-MATCH solution, but to no avail.
My best guess was using COUNTIFS, but when I do COUNTIFS(Sheet2!A:A, A2, Sheet2!B:E,"P")) I get an error message that says, "Array arguments to COUNTIFS are of different size."
Any help would be appreciated!
=SUMPRODUCT((Sheet2!$A$2:$A$8=A2)*(Sheet2!$B$2:$D$8="P"))
Place the above formula in Sheet1, cell B2 and copy down.

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

How to Make One Cell equal different cell values on multiple sheets and locations

I'm working in Excel 2010, and my question is how do I make a cell (say on one sheet to equal a specific value placed on another sheet). I thought the following formula would do it but it doesn't work.
=IF(COUNTIF(Name,$A2)=1,VLOOKUP($A2,Name,2,FALSE),''))
If I understand your question, you simply want one cell to represent the value of another cell from another sheet? If so, the formula will look like this: =[name of sheet]![cell reference] EG: =sheet2!A1
If used in cell A1 on sheet 1, this would put the value of cell A1 from sheet2 into A1 of sheet 1.
If you modify your question so that you reference the actual sheets & cells you're interested in, I can help you with the formula.
You can easily facilitate this by writing your formula in the bar, then when you need to reference a cell on a different sheet, simply navigate to the sheet & cell to insert it's address into the formula, then carry on with your formula if necessary.

referencing the items in spreadsheet between different sheets

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.

Resources