Evaluate Function, named range and Condition problem

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

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
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

Forum statistics

Threads
1,215,455
Messages
6,124,938
Members
449,197
Latest member
k_bs

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top