In the following worksheet in Excel, the formula of D3 is =UNIQUE(B3:D9), the formula of F3 is =SORT(D3#), where D3# refers to the dynamic result of D3.
In Google Sheets, we could well write =UNIQUE(D3:D9), and the function SORT exists. But # does not work. Does anyone know how to write such a dynamic reference?
Data is implicitly dynamic at Google. Write:
=SORT(D:D)
instead.
You can use =SORT(D3:D) here D3:D will refer cells from D3 to last last of column D. For UNIQUE() you can try
=UNIQUE(D3:D)
Related
I am new here, so apologies if this has been answered before.
I am trying to create a VBA script to transform cells using SUMIFS to pull data to individual cell references.
Ie. if I pull a value from another tab using a SUMIFS function, I want the output to be exactly the cell it is referenced (=cell).
Specifically, I am thinking of:
Read all cells in a sheet,
Identify which cells pull value with a SUMIFS function
Get the cell reference from which the data matching the SUMIFS is sourced
Convert the SUMIFS formula to the matching cell reference (ie. =A35)
I am trying to see individual codes for this, but not sure where to begin with, or if this has been previously solved.
Any thoughts will be highly appreciated!
Thank you!
Tried the above steps
I'm trying to create a dropdown list in Excel based on my source data by using the UNIQUE function, like say column "Team" has Team01-Team10 which is fetched with =UNIQUE(table[teams]), and then I want to add an asterisk to that list and still be able to use it dynamically for a data validation list. Like I can when I only have the original values by referencing A1# (if we say the formula is in A1). Does someone have a creative solution for this?
I have tried combining cell reference and the string * in data validation, which does not work. I have also tried putting the formula in A2 instead, and then writing the asterisk * in A1 and creating a named range, referencing A1:A2#, which basically throws the same error.
You can use TEXTJOIN and FILTERXML to create an array with the *.
=FILTERXML("<a><b>*</b><b>"&TEXTJOIN("</b><b>",,UNIQUE(table[teams]))&"</b></a>","//b")
Maybe i don't understand your question, i just look at the answer of #Scott Craner,
please forgive me if I am wrong, here is my formula:
=UNIQUE(IF(ISERROR(1/(ROW(1:6)-1)),"*",C2:C7))
With the cell A1 containing a formula saved as string. Ex: Sum(B1:B5)
In A2 I want to execute content of A1. But when I put =(=A1) in A2 excel gives me formula error. Is there any way I can execute content of A1 in A2 as formula
Mind you no VBA is allowed. Can someone please help?
Please only those people should answer who have done this thing in the past. No hit and tries please
=A1
that's all you need to point the value to the value in cell A1
With VBA :
with VBA you can write some custom function and then evaluate the formula.
Then call the function in excel wherever you required like below
=eval_formula(A1)
Function eval_formula(fr)
eval_formula = Evaluate(fr.Value)
End Function
Refer the link here for more details
https://superuser.com/questions/253353/excel-function-that-evaluates-a-string-as-if-it-were-a-formula
without VBA:
Create a named range and use the named range inside the cell, I have attached the screenshots for your reference
hope this is what you required.
The Evaluate function doesn't exist in Excel anymore.
The only way you can use to evaluate properly is unfortunately only VBA.
In addition to the good answer of Durgaprasad. Here are some other ways to evaluate in the related question:
How to turn a string formula into a "real" formula
I have a query that will generate the following formula in an array from SQL and set into a range in worksheet, but it's difficult to read:
=SUMIF(INDIRECT(ADDRESS(ROW()-1,5)&":"&ADDRESS(ROW()-6,5)),"+",INDIRECT(ADDRESS(ROW()-1,COLUMN())&":"&ADDRESS(ROW()-6,COLUMN())))-SUMIF(INDIRECT(ADDRESS(ROW()-1,5)&":"&ADDRESS(ROW()-6,5)),"-",INDIRECT(ADDRESS(ROW()-1,COLUMN())&":"&ADDRESS(ROW()-6,COLUMN())))
So dose excel contain any method to change only the address part INDIRECT(ADDRESS(ROW()-1,5)&":"&ADDRESS(ROW()-6,5)) to E10:E5 for easy to trace?
Because of the formula is needed to be dynamic generate before set to worksheet (i.e. dynamic column and row), so it should be needed to simplify after set the array to cell.
Any method can do the similar thing like Evaluate function in excel but only apply for INDIRECT and ADDRESS which allow user to read the simply formula like =SUMIF(E10:E5,"+",J10:J5)-SUMIF(E10:E5,"-",J10:J5)
To simplify the formulas, you could enter in RC notation by changing the reference style to R1C1 or using .FormulaR1C1. The advantage of RC notation is that the formula text is consistent down the whole column. For your formula above you could enter either as:
=SUMIF(R[-6]C5:R[-1]C5,"+",R[-6]C:R[-1]C)-SUMIF(R[-6]C5:R[-1]C5,"-",R[-6]C:R[-1]C)
or =SUM(SUMIF(R[-6]C5:R[-1]C5,{"+","-"},R[-6]C:R[-1]C)*{1,-1})
and the formulas should be easy to read in A1 notation.
I'm trying to utilize a row and a column header to build a function that I can fill across an excel table (range of cells, not excel table object). So, for example I have a row header "BAT61" and column headers "A","B","C"...
I'd like to create a formula that generates the following results in those columns: =min(BAT61A),=min(BAT61B), =min(BAT61C)... Where those generated names match named ranges that have already been created.
I've attempted to use =index without success (I generally get a #ref error). I'd prefer a non-vba solution, if at all possible. Any help is appreciated.
UPDATE:
I've tried the indirect function but gotten the same #ref error. I've verified that the named range exactly matches the text string I'm trying to pass. I've tried the following variations with the same result #ref: =min(indirect(A1))[where A1 is the cell with "BAT61A"], =min(indirect(BAT61A))[to try and get the result directly], and =min(indirect(A1&A2))[where A1="BAT61" and A2="A"]. But, when I create a "Test" range, like suggested-it works. Any further ideas would be appreciated.
UPDATE2: I was able to get it working with several slight modifications. My named ranges that did't work were actually referring to fairly extensive array formulas that were parsing select rows from a table. When I created new dummy columns in the table that basically did the filtering, the indirect would pull the correct columns based upon the indirect.
Name some cells "Test" then you can use:
=MIN(INDIRECT("Test"))
http://www.cpearson.com/excel/indirect.htm
The name can be constructed using the & operator = $A1&B$2
For reference of others, use the function "Address" and "Indirect" in combination to achieve the above behavior.
Here is a sample for using values in cells to create formulas
=INDIRECT(ADDRESS(E6,K2))
Assuming cell
E6 holds 3 and
K2 holds 4
The above formula will return
=INDIRECT($C$4)
Assuming cell
C4 holds This is a test
The above formula will return
This is a test