if statement with Logic_Test in another cell

cidfidou

Board Regular
Joined
Jan 19, 2009
Messages
163
Hi Guys,

Is it possible to use a if statement with the Logic_Test is another cell?

For example in A1 I have entered = >10

I am trying: =if(12=A1,1,0) but doesn't work ...

Any help would be really appreciated
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
it will not see >10 as a value and so
a1=12 will not see >10 as 12 only as text

you could possibly do something with the symbol and number and extract from the cell
BUT what are the possible combinations
 
Upvote 0
Hi Etaf

thanks for your answer.. basically I am trying to assign categories to a range of data for which I will have different criteria i.e.and i don't want to hardcode the ">X' in the if statement.. the idea would be to change the criteria cell and not the formula,,, is there a way around? thanks
 
Upvote 0
will it always be > only with a number

what is the criteria cell ?
A1
not sure i understand

does this work ?



12=a1
is that the bit that you dont want to change

if A1 is allways
>
=MID(A1,2,10)*1

=IF(MID(A1,2,10)*1 = 12, 1,0)
 
Last edited:
Upvote 0
thanks for helping.. the criteria cell is A1 and could be: >10, <10, >5..

What I am trying to do is to reference A1 as the logical test in a if statement .... this way I could update A1 and not the if statement if that make sense...

so in the example above in A1 the criteria is >5, how can we reference the criteria in A1 to check if lets say 10 is '>5'.. thanks again for ur help
 
Upvote 0
If you are just returning 1 and 0, TRUE and FALSE can be coerced to 1 and 0 by doing math on it, usually adding 0.

=(COUNTIF(a2,a1)=1)+0

will return the same value as your formula with 1 less function.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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