Using Indirect with a ">=" as an argument

nigelk

Well-known Member
Joined
Aug 30, 2008
Messages
535
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:

Some videos you may like

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
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.
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,683
Office Version
  1. 2010
Platform
  1. Windows
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)
 

wideboydixon

Well-known Member
Joined
Jun 2, 2016
Messages
3,401

ADVERTISEMENT

If it's a one-off then there's a sneaky way to use "Define Name" on the formulas tab:

<b></b><table cellpadding="2.5px" rules="all" style=";background-color: rgb(255,255,255);border: 1px solid;border-collapse: collapse; border-color: rgb(187,187,187)"><colgroup><col width="25px" style="background-color: rgb(218,231,245)" /><col /><col /><col /><col /></colgroup><thead><tr style=" background-color: rgb(218,231,245);text-align: center;color: rgb(22,17,32)"><th></th><th>A</th><th>B</th><th>C</th><th>D</th></tr></thead><tbody><tr ><td style="color: rgb(22,17,32);text-align: center;">1</td><td style="text-align: right;;">10</td><td style="text-align: right;;">20</td><td style=";"><=</td><td style="text-align: right;;">TRUE</td></tr></tbody></table><p style="width:4.8em;font-weight:bold;margin:0;padding:0.2em 0.6em 0.2em 0.5em;border: 1px solid rgb(187,187,187);border-top:none;text-align: center;background-color: rgb(218,231,245);color: rgb(22,17,32)">Sheet1</p><br /><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Worksheet Formulas</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Cell</th><th style="text-align:left;padding-left:5px;">Formula</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">D1</th><td style="text-align:left">=Answer1</td></tr></tbody></table></td></tr></table><br /><table width="85%" cellpadding="2.5px" rules="all" style=";border: 2px solid black;border-collapse:collapse;padding: 0.4em;background-color: rgb(255,255,255)" ><tr><td style="padding:6px" ><b>Workbook Defined Names</b><table cellpadding="2.5px" width="100%" rules="all" style="border: 1px solid;text-align:center;background-color: rgb(255,255,255);border-collapse: collapse; border-color: rgb(187,187,187)"><thead><tr style=" background-color: rgb(218,231,245);color: rgb(22,17,32)"><th width="10px">Name</th><th style="text-align:left">Refers To</th></tr></thead><tbody><tr><th width="10px" style=" background-color: rgb(218,231,245);color: rgb(22,17,32)">Answer1</th><td style="text-align:left">=EVALUATE(<font color="Blue">Sheet1!$A$1&Sheet1!$C$1&Sheet1!$B$1</font>)</td></tr></tbody></table></td></tr></table><br />

WBD
 

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,683
Office Version
  1. 2010
Platform
  1. Windows
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
 

Watch MrExcel Video

Forum statistics

Threads
1,122,569
Messages
5,596,915
Members
414,110
Latest member
docops

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
Top