Reading and executing formulas from text - excel

I have a problem where I have a need to execute a complex formula saved as text.
I can only find VBA and EVAL() solutions, which cannot be used in my situation.
For example, I have a cell with:
IF(VLOOKUP($A1;Summary!$E:$K;1;TRUE)=$A1;VLOOKUP($A1;Summary!$E:$K;7;TRUE);0)
and I would like a formula in another cell to have the result obtained when running the example formula.
I get a #REF! error when trying INDIRECT()
Edit: Basically, is there a way to run EVALUATE() formula without defining your own formula through "Name manager" that does just that.

Assuming you want to display the result right to the right of the formula text.
Suppose the formulatext is in cell A2.
Select cell B2
Control+F3, Add
Name: EvalFormula
RefersTo: =EVALUATE(A2)
OK your way out
in B2 enter =EvalFormula

Related

Problem with IF AND and Vlookup nested formula

I am trying to put a nested IF, AND and Vlookup formula. I want formula to return the value "0.17" in cell F3 if cell D3 has text "pasha" and B3 is not equal to cells mentioned in vlookup formula but its returns zero instead of showing 0.1. Please guide, TIA
=IFERROR(IF(AND(D3="Pasha",VLOOKUP(B3,G70:H78,2,0)<>B3),0.17,IF(VLOOKUP(B3,$B$69:$B$89,1,0)=B3,0.15,"")),0)
enter image description here
You may want to replace
VLOOKUP(B3,G70:H78,2,0)<>B3)
(Excel will unsuccessfully try to match B3 value with values from G column range while it contains different type of data:“Pasha”)
with
NOT(ISNUMBER(MATCH(B3,H70:H78,0)))
And feel free to adjust the second VLOOKUP accordingly.
So, how about this:
You need to to sort the vlookup() but the process for testing the conditions is there.

Auto Copy and Paste Cell Values not Formula to another Cell

I also need to get your help for the same issue. I need to copy the cell values and not the formulas automatically to the other Cell, "automatically" meaning, I don't need to click, use mouse, or any other means to do that, like once theres a value on that specific cell (which is derived from a formula), the value will automatically be copied and pasted in the other cell (without any intervention from my part) (Only the value is copied not the formula)
Note:
The cell should contain only the copied value and not the formula.
Scenario:
A1 Cell : has 250 value
B1 Cell : has a vlookup formula to search for the value of A1 cell (I need to use VLOOKUP as there's a lot of items in the list, and it is "Dynamic", the reason I cannot just use formula "=A1" to get the value directly)
C1 Cell : Needs to copy and paste only the plain value from B1 cell which is 250, not including the vlookup formula, it should be automatically copied without any intervention (Cannot use VBA code / Macro as it will be run in excel online)
Thanks!!
Just use abasic Excel formula.
Example:
The source data is in cell A1.
You want to copy the same value to cell B1.
In cell B1 write:
=A1
That is all.
Additionally, you need to configure correctly the strategy for calculating the formulas:
I managed to find a solution, sharing as might help someone in the future, just needed to use =value(A1), instead of just "=A1", when I did this, the chart can read the values as it is and not the formula behind it. Found another work around as well, by using the formula =A1+0, for some reason this works too. –
=value(A1) works perfectly , If that formula contains a % figure , simple We can multiply by 100 to get the correct value.

EXCEL - #VALUE on INDIRECT

I'm getting a #VALUE error on an INDIRECT() and can't figure out why. I've never used this function before, so I'd appreciate some pointers.
I'm constructing a string in a cell. The constructed string has a value of the form [items.xls]items!$A$1:$F$30.
For purposes of this question, suppose the constructed string is in cell $A$1 of Sheet1 in workbook1.xls. in cell $B$1, I have =INDIRECT(A1), which I'd hoped would create the actual reference constructed using cell $A$1 so I could use the reference in a VLOOKUP(), but I can't get that far because of the #VALUE error.
I have the workbook items.xls open in excel at the same time as workbook1.xls.
the spreadsheet items exists in workbook1.
what am I doing wrong ?
Because your reference in cell $A$1 is to a range of cells (and not just one cell), you need enter your =Indirect(A1) formula as an array formula.
Select range Sheet1!$B$1:$G$30. 30 rows, 6 columns; the same size as [items.xls]items!$A$1:$F$30.
Type your formula =INDIRECT(A1) into the formula bar. Instead of pressing Enter, press Ctrl+Shift+Enter to complete your formula.
The formula should look like {=INDIRECT(A1)} in the cell.
Check that none of the cells in range [items.xls]items!$A$1:$F$30 has a #VALUE error. If they do, that error will show on your new sheet as well.
Also double-check your formula that constructs the string in cell A1. If part of that formula is returning a #VALUE error, it will pass it on to the INDIRECT() formula.
You can highlight parts of your formula in the formula bar and press F9 to evaluate just that part of the formula. Just remember to hit ESC to exit the cell afterward.
Another alternative is the Evaluate Formula option on the Formulas part of the Excel ribbon menu.

How to evaluate the content of another cell in the same spreadsheet without any VBA or any other addon

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

What is wrong with this Excel formula to sum() next 2 columns in the same row?

I did try to enter in a cell formula:
=SUM(ADDRESS(ROW(),COLUMN()+1):ADDRESS(ROW(),COLUMN()+2))
Intention is summing next 2 cell in the same row.
But the spreadsheet complains with error on it!
Used functions: ADDRESS(ROW(),COLUMN()+1). Work fine but together - not!
In B7 cell:
(I need to write a generic formula that is independent from location and calculates the sum of the next tho cell in the same row.
I am not interested in specific addresses or in a way to copy any specifically written formula across a spreadsheet.
I need a formula that works independently from a location!
Is it possible in Excel at all?)
Thanks.
ADDRESS returns address as a string. You cannot SUM it because SUM(A2:A3) is very different from SUM("A2:A3").
You could look into SUM(INDIRECT("A2:A3")), but you should not, for the mere reason that Excel's formulas are already relative unless made absolute.
If you want to sum two cells to the right of B7, enter =SUM(C7:D7) to B7. The formula will change if you copy it to another cell.
If you meant to enter the formula with a macro, then use the R1C1 notation and enter =SUM(RC[1]:RC[2]).
sorry im dont speak english , but a have what you need
= SUM(INDIRECT(CONCATENATE(ADDRESS(ROW();COLUMN()+1);":"; ADDRESS(ROW();COLUMN()+2))))
Regards

Resources