If = do nothing

Phil Payne

Board Regular
Joined
May 17, 2013
Messages
131
Office Version
  1. 365
Platform
  1. Windows
Hello all,

Is there a way to set up an ‘IF’ formula that when condition is not satisfied the result is ‘do nothing’? (it doesn't have to be IF but it does need to be an in-cell formula)

Normally you would have something like - =IF(A3=3,"Yes","No") - obviously this basically means whatever the value of A3, you have to do something i.e. respond with “Yes” or “No”.

Is there a way to get it to do nothing when the condition is not met?


e.g. =IF(A3=3,[Do Something],[Do Nothing])

Thanks,

Phil




 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
My apologies J Ty,
I meant to reply at the same time as to the others.
I tested your suggestion and found it worked but when any number was entered. I need it to work only when a specific number (3) is entered.
Thanks for taking the time to help me.
Regards,
Phil.
 
Upvote 0
Then use =IF(A1<>3,MAX(0,B1),MAX(1,B1)).

J.Ty.
 
Upvote 0
Hello J.Ty,


Regarding =IF(A1<>3,MAX(0,B1),MAX(1,B1))


This responds with 1 when 3 is entered which is good and I noticed that it works even if the A1 cell is a linked cell - receiving its 'value' from elsewhere - this had me very interested and I think distracted me a bit.


On further testing I saw that if any other another number subsequently replaces 3 the result returns to 0 from 1. I need the result 1 to remain.


Any other suggestions would be gratefully received.


Thanks very much for your efforts on my behalf.


Regards,


Phil.
 
Upvote 0
Hello J.Ty,


Regarding =IF(A1<>3,MAX(0,B1),MAX(1,B1))


This responds with 1 when 3 is entered which is good and I noticed that it works even if the A1 cell is a linked cell - receiving its 'value' from elsewhere - this had me very interested and I think distracted me a bit.


On further testing I saw that if any other another number subsequently replaces 3 the result returns to 0 from 1. I need the result 1 to remain.

Dear Phil,

1. You need to enable iterative computations in the Excel options
2. The above formula is intended for entering in cell B1 and nowhere else: it must contain two references to itself.

Under these two conditions it works as you desire.

J.Ty.
 
Upvote 0
Dear Phil,

1. You need to enable iterative computations in the Excel options
2. The above formula is intended for entering in cell B1 and nowhere else: it must contain two references to itself.

Under these two conditions it works as you desire.

J.Ty.

My mistake was placing the formula in B2!

I used the default settings for iterations -that OK?

Will this slow things down too much if I have worksheet with around 7000 instances of this formula?

Thank very much.

Phil
 
Upvote 0

Forum statistics

Threads
1,226,694
Messages
6,192,473
Members
453,726
Latest member
JoeH57

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