Operator as input

carruda

New Member
Joined
Apr 1, 2011
Messages
3
Is it possible to write a formula using operators as input ? for exemple:

input 1: a1=5
input 2: b1=+
input 3: c1=2
output (normal situation): d1=a1+c1=7
output (desired): e1=formula(a1;b1;c1)=7

I was try to use concatenate, but it is not working, or it is necessary to create a udf ?
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
You could make a UDF or you can create a "Name" to evaluate a string.

Evaluate a Name:
  • Select from the menu Insert\Name\Define
    • Name: EVAL1
    • Refers To: =EVALUATE(A1&B1&C1)
    • Click the ADD button
    • OK

Put this in any cell (except A1 or B1 or C1)
=EVAL1
 
Upvote 0
the formula is perfect for a defined range, but i have a 300 lines database, i mean, variable range.

Is it possible to write a udf for this purpose ?
 
Upvote 0
It could work for a variable range sort of.

If you have say cell D1 selected when you make the "Name" with this refers to formula =EVALUATE(A1&B1&C1). Then A1,B1,C1 are relative offsets from the currently active cell (D1). So the name EVAL1 will always refer to the three cells to the left of the cell that contains the the formula =EVAL1

So as an example, if you put =EVAL1 in in say cell H1, then it will evaluate the three cells to the left of H1 (E1,F1,G1).

If you drag the the formula down from D1, it will evaluate the three cells to the left of the formula for each row.

Does that help?
 
Last edited:
Upvote 0
Are the operators always +?

If so, just use SUM on the range, it will ignore the plus signs and sum all the values.
 
Upvote 0
I wil test the evaluate formula, thank you very much.

The operators are input varialbles (+,-<,>)

I found a solution using & , copy, paste, value, but it is not simple.

Thank you
 
Upvote 0

Forum statistics

Threads
1,224,592
Messages
6,179,789
Members
452,942
Latest member
VijayNewtoExcel

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