Check for specific formula (no VBA) - excel

Is it possible to check if cell formula is a specific formula, and not just "isformula" ?
My example:
In cell A1 I have, normally, "=B2".
But during the use of this sheet the formula might be overwritten to "=D4".
How can I get a simple TRUE result if the formula in cell A1 is "=D4", and FALSE if it's something else ?
I get fix it with VBA but I prefer to use standard formulas first (if it's possible obviously).
Thanks for your time.

Using FORMULATEXT:
=FORMULATEXT(A1)="=D4"

Related

change cell color with conditional format

I wanna ask about Ms. excel. maybe it will look so basic for someone who always work with excel. so thank you for anyone who help me with this.
I have sheet1 and sheet2. so i want to make cell in column A sheet 1, which have same data exist in column A sheet2 to change color automatically.
I don't know how to make it work so I made column helper in column c sheet1 with this formula
=NOT(ISERROR(MATCH(a2;sheet2!$A$2:$A$1000;)))
and get true if the data exist in sheet2. and then I drag that formula so all column c have this formula.
I thinking using conditional formatting, so I block column A in sheet 1, and make conditional formatting with formula
=C:C= "TRUE"
but this not work. i really a newbie and only study by myself from internet, but i dunno how to search to solve this problem.
any help or advice for this problem?
thank you so much before
You can put the formula that returns TRUE or FALSE directly into the conditional formatting rule.
You should define it on cell A2 first, then change the 'Applies to' range to be all the rows you want to test. If you can, I recommend you try to avoid using references like C:C.
So, supposing you want to test the data in cells A2:A10 on sheet1, then your rule would look something like this:
Note that my locale uses comma as parameter separator and not semi-colon, so you should adjust accordingly.
Try the following formula in CF rule.
=COUNTIF(Sheet2!$A:$A,"*"&$A1&"*")>0

Excel with Blank cells and a IF/AND statement

I have cells A1-A7 with A1 needing the formula. Cells A2-A7 have dropdown list options of "Y" or "N". What I'm needing is for A1 to remain blank until a "Y/N" option is chosen for cells A2-A7. Once A2-A7 have data (Y or N) I need them to be evaluated so that if there is a "N" in any cell of A2-A7, then A1 will display "N". If no "N" is input in A2-A7, then A1 will display "Y"
The formula I'm currently using in cell A1 is:
=IF(COUNTBLANK(M3:M7)>0,"",(IF(AND(M3="N",M4="N",M5="N",M6="N",M7="N"),"N","Y")))
This formula is keeping the A1 cell blank no matter what is input into A2-A7. Any ideas?
There's several ways to do this, but the one first coming to mind for me is to rewrite the second part of your formula.
Keep this part, to check if you have all of your cells filled out
IF(COUNTBLANK(M3:M7)>0,"",
Then, I'd use the same method for finding out if any of the cells hold the value "N"
IF(COUNTIF(M3:M7,"N")>0;"N";"Y")
This is a personal choice, but I find reading the code is easier if you use versions of the same function like this.
The whole code would then be
IF(COUNTBLANK(M3:M7)>0,"",IF(COUNTIF(M3:M7,"N")>0,"N","Y"))
PS: I saw in the comment someone suggested splitting the original formula up in different cells to figure out where it goes wrong. There's also a built-in function that allows you to calculate a formula step-by-step and see the results. It's called Evaluate Formula and can be found under the Formula section.

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.

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