Using Indirect with a ">=" as an argument

nigelk

Well-known Member
Joined
Aug 30, 2008
Messages
537
Hi

In A1 I have 10
In B1 I have 20

In cell C1 the user enters either ">=" or "<="
Using a formula it would be =A1>=B1

But I need to replace the hard coded >= with whatever the user enters in C1

Can anyone help?

Thanks,Nigel.
 
Last edited:

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
There's no function that can do that I'm afraid.

But if it's 'really' just those 2 possible operations >= or <= then you can just do this

=IF(C1=">=",A1>=B1,A1<=B1)

I can see nesting maybe 4 or 5 possible operations to use, any more than that I'd suggest a VBA solution.
 
Upvote 0
This formula would return 1 if the relationship is true and 0 if false...

=COUNTIF(A1,C1&B1)

If you actually need to see TRUE or FALSE, then you can use this formula...

=IF(COUNTIF(A1,C1&B1),TRUE,FALSE)
 
Upvote 0
If it's a one-off then there's a sneaky way to use "Define Name" on the formulas tab:


Book1
ABCD
11020<=TRUE
Sheet1
Cell Formulas
RangeFormula
D1=Answer1
Named Ranges
NameRefers ToCells
Answer1=EVALUATE(Sheet1!$A$1&Sheet1!$C$1&Sheet1!$B$1)


WBD
 
Upvote 0
This formula would return 1 if the relationship is true and 0 if false...

=COUNTIF(A1,C1&B1)

If you actually need to see TRUE or FALSE, then you can use this formula...

=IF(COUNTIF(A1,C1&B1),TRUE,FALSE)
Actually, I like Marcelo's idea for forcing TRUE/FALSE; here is how it would be applied to my formula approach...

=COUNTIF(A1,C1&B1)=1
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,289
Members
452,631
Latest member
a_potato

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