I have an excel spreadsheet with numerous worksheets. I have a cell in Worksheet 1 that is a drop down list.
This cell is then populated on worksheet 2 C7 using a cell reference (i.e. ='Worksheet 1'!J30)
I want another cell on worksheet 2 that says if C7="Other" to then get the cell reference from 'Worksheet 1'!K30
Is this possible? Or is there a better way. It is a drop down list of suppliers.
Are you writing IF statement in VBA?
Related
Trying to dynamically get cell value from worksheet in same workbook, depending on worksheet name in column E
=IF(E108<>"",INDIRECT(CELL("contents", E108)&"!"&F$1),"")
The formula set out above does not work.
I have evaluated the formula with the excel tool and have detailed each step below:
IF("P3672A"<>"",INDIRECT(CELL("contents", E108)&"!"&F$1),"")
IF(TRUE,INDIRECT(CELL("contents", E108)&"!"&F$1),"")
IF(TRUE,INDIRECT("P3672A"&"!"&F$1),"")
IF(TRUE,INDIRECT("P3672A!"&F$1),"")
IF(TRUE,INDIRECT("P3672A!"&"D9"),"")
IF(TRUE,INDIRECT("P3672A!D9"),"")
IF(TRUE,#REF!,"")
I can confirm that the cell D9 in worksheet P3672A does exist and contains a value.
Don't know why the formula does not work. Please can someone help with this
I've been researching this one for a while now with no luck, so thought I would open it up here...
Let's say you have two worksheets in an excel workbook, e.g. sheet1 and sheet2.
Now, in sheet2 cell A1, say you have a hyperlink that refers/points/links to sheet1 cell A1. In other words, the value of the cell reference of the hyperlink at sheet2!A1 is sheet1!A1
Do you know if there is a formula or function that would return the cell reference of that hyperlink.
i.e.
=<formula-or-function>(sheet2!A1)
which returns 'sheet1!A1' as its result.
You can retrieve the .SubAddress from the Hyperlinks.Item Property.
'by the active cell
With ActiveCell
Debug.Print .Hyperlinks.Item(1).SubAddress
End With
'by worksheet and cell address
With Worksheets("Sheet2").Range("D6")
Debug.Print .Hyperlinks.Item(1).SubAddress
End With
This is, of course, VBA. I know of no way to perform this action with a worksheet formula short of a User Defined Function (aka UDF) written in VBA.
I want to compare multiple worksheets and check if there is any cell that has repeated value. e.g. lts say I have worksheets WS1, WS2, WS3, WS4, WS5. each of these worksheets have data from cells A1 through H10.
Now lets say I have another worksheet named "RWS". I want A1 call entry in RWS to be 1 if A1 cells in Ws1 through WS5 has all different values and 0 if any of those values is repeated and occurred more than once.
Is there any short way to do this?
You could use formula with 3D reference on sheet RWS:
=IF(MAX(FREQUENCY(WS1:WS5!A1,WS1:WS5!A1))>1,0,1)
Is this possible?
=IF(COUNTIF('**ALLSHEETS**'!D4, "ICT"),**SHEETNAME**, FALSE)
Excel will look up a a specific value ("ICT") in the same cell in every sheet then if that cell contains the value it will return the name of the sheet(s)
You can do it with a little trick
Put this Formula in Cell A1 of Everysheet you want to get searched
=IF(D4="ICT",MID(#CELL("filename",A1),FIND("]",#CELL("filename",A1))+1,255),"")
Then, in the required sheet!cell add all sheets like
=Sheet1!A1&Sheet2!A1&Sheet3!A1
Note: If it would be only one sheet having ICT and you are trying to find the sheet name, then this would be the easiest solution
But in case of multiple sheets having ICT in D4, the result would be a like
sheet1sheet2sheet3 in the same cell.
When I write a formula to compare data in different workbooks, the formulas looks very cluttered since each time I reference a value in a different workbook, the entire name of the workbook appears in the formula. Is there a way to assign an alias to the workbook name so the formula is more readable?
The simplest way would be to store the path to the workbook in bits(separate cells)
using variables(Text in Cells) in book1 type:
A1 = book2
A2 = Sheet1
A3 = A1
Now go to any empty cell in book1 and type the formula
=INDIRECT("'["&A1&"]"&A2&"'!"&A3)
The Indirect() pulls values from the Cells and replaces them creating a string which in the end is equal to =[Book2.xlsm]Sheet1!A1
So, instead of hard-coding the names of other opened workbooks, sheets, or ranges you can use values you entered in any other cell in your book1.
Now if you were to compare the value against some other cell from the other book, replace the A3 with the actual value or change the A3 from A1 to some other cell
There is a downside to the =INDIRECT() function. It does NOT work with closed workbooks.
You can use a named range to refer to a different workbook.
Just add a named range as normal and enter:
=[WorkbookName]Sheetname!Range
eg
=[Book1]Sheet1!$A$1:$A$10
You can then use this in formulas that take ranges, to refer to an individual value can be trickier and you'd need to use lookup/index.