AND / OR formula not working properly in data validation tool - excel-formula

I'm trying to type a formula in the data validation tool but it's not working. Can someone please tell me the issue?
Wanted logic is :
IF cell A109 = "test1" or "test2" AND cell B109 is empty, then, I dont want to be able to fill cell B111.
My formula :
=AND(OR(A109="test1", A109="test2"), NOT(ISBLANK(B109)))
Why isn't it working?

Related

Data validation gives error normal cell doesnt

I have this formula
=OFFSET(Products[[#Headers];[Merk]];
MATCH(A2;Producten!$A:$A;0)-1;1;COUNTIF(Producten!$A:$A;A2);1)
It works fine in a normal cell. But as soon as I putt it in the Data Validation>List I get the error.
There is a problem with this formula.
Not trying to type a formula?
Does anybody know what the problem is?
Suggest to change the reference to the Table for the cell address (e.g. assuming the table starts at B6 and Merk is the 1st field then change Products[[#Headers];[Merk]] for B6).
Not all formulas that are valid for Cells are accepted by DataValidation, particularly when they refer to a ListObject for example the formula COUNTA(Products[Merk])is valid in a Cell but not accepted by DataValidation
Formula should be:
=OFFSET(B6;
MATCH(A2;Producten!$A:$A;0)-1;1;COUNTIF(Producten!$A:$A;A2);1)
When referring to a table in a validation formula you cannot refer directly to a table and must use intermediate names.
For example, define a name like this:
_name_Product that is equal to: ="Products[[#Headers];[Merk]"
Then use INDIRECT in the formula:
INDIRECT(_name_Product)
or use entries like INDIRECT("Products[[#Headers];[Merk]")
Hope this helps.

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

Increment excel value if range of cells contains "active"

I've worked with excel formulas for a while now and can't quite figure out where my logic is flawed.
My goal is to increment a specific cell by 1 every time a range of cells contains the word "Active"
I thought I could do this by using the command: "=SUM(IF(B2:B50="Active",1,0))"
Can someone tell me what im doing wrong?
Maybe you want something like:
=COUNTIF(B2:B50,"Active")

VBA to shift formula reference down one row

I'm currently working on a massive file, that compares year/year data.
Every week I need to update a formula in the file to move down a row. I want to make a command button to update these formulas.
Here is a simple example
cell c800 contains: =((C235-C229)/C229)*100
I would like to click the button to make the cell update to
=((C236-C330)/C330)*100
Can anyone help me out here? is this possible? I've been looking all over for this and can't find anything.
thanks
Enter this formula in C800 and it will always capture any newly added lines of data.
=(INDEX(C5:C799,MATCH(1E+99,C5:C779,1))-INDEX(C5:C799,MATCH(1E+99,C5:C779,1)-6))/INDEX(C5:C799,MATCH(1E+99,C5:C779,1)-6)*100
assumes first data point is in C5. Change as needed
This works because MATCH(1E+99,C5:C799,-1) finds the last numerical value in the column.
there is a function to do that, as if the cell containing the formula was copied somewhere else and the cell references in the formula were shifted/moved:
strFormulaMoved$ = Application.ConvertFormula(Application.ConvertFormula(Selection.Formula, XlReferenceStyle.xlA1, XlReferenceStyle.xlR1C1, , Range("C800")), XlReferenceStyle.xlR1C1, XlReferenceStyle.xlA1, , Range("C800").Offset(1, 0))

excel - Using the value from one cell to reference value in a different sheet

I'm trying to get the value in one cell to be used to reference another cell.
So far what I've found is that the following formula should do the trick but somehow I can't get it to work.
In cell E5 I have the sheet name which is build up as XX-XX-XX-XX in which the XX's are all numerical values.
In another cell I want to have the data that's in cell D2 from the sheet 12-12-12-12.
I have tried the following formula but something doesn't seem to work:
=INDIRECT("'"&E5&"'!"&"D2")
If I check out the formula in error check it goes to this before it fails:
=INDIRECT("'12-12-12-12!D2")
Does anyone know a solution for this?
=INDIRECT("'"&E5&"'"&"!D2")
or if you want the cell reference separate from the !
=INDIRECT("'"&E5&"'"&"!"&"D2")

Resources