martin1385
New Member
- Joined
- Mar 4, 2015
- Messages
- 1
Hi,
I've got the following issue:
I'd like to enter a condition/validation as a text (so that it's readable and understandable for everyone) and then excel to calculate the value.
For example I've got a named range "income" with the values 50 and 70.
Now, the first condition is "income<60". I used the EVAL function
And in the cell C2: "income<60" and in D2 and D3: =EVAL(C2). If I enter the formula with Ctrl + Shift + Enter it works on every row. Perfect so far.
Now I've got more complex conditions like "AND(income>10, income<60)". But this don't work for each row, but takes all income values and calucaltes something like AND({50, 70}>10, {50, 70}<60) and the result is false.
Any idea how I can solve this? I'd like to keet the condition as simple (and human readable) as possible. The VBA could be complex.
I tried everything I know, but no luck. Also I searched but couldn't fine anthing that specific.
Hope anyone can help me.
Here you find an example file: https://dl.dropboxusercontent.com/u/10095862/example.xlsm
Many thanks in advance!
Martin
I've got the following issue:
I'd like to enter a condition/validation as a text (so that it's readable and understandable for everyone) and then excel to calculate the value.
For example I've got a named range "income" with the values 50 and 70.
Now, the first condition is "income<60". I used the EVAL function
Code:
Function EVAL(Ref As String)
Application.Volatile
EVAL = Evaluate(Ref)
End Function
And in the cell C2: "income<60" and in D2 and D3: =EVAL(C2). If I enter the formula with Ctrl + Shift + Enter it works on every row. Perfect so far.
Now I've got more complex conditions like "AND(income>10, income<60)". But this don't work for each row, but takes all income values and calucaltes something like AND({50, 70}>10, {50, 70}<60) and the result is false.
Any idea how I can solve this? I'd like to keet the condition as simple (and human readable) as possible. The VBA could be complex.
I tried everything I know, but no luck. Also I searched but couldn't fine anthing that specific.
Hope anyone can help me.
Here you find an example file: https://dl.dropboxusercontent.com/u/10095862/example.xlsm
Many thanks in advance!
Martin