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.
Thanks J.Ty.

One last question - where we have been returning 1 as the result, is there a way to return the current date instead?


Phil.
 
Upvote 0
Thanks J.Ty.

One last question - where we have been returning 1 as the result, is there a way to return the current date instead?


Phil.

Dear Phil,

I understood that you explicitly didn't want any method of reversing the change from 0 to 1.
In the following example cell C1 is a special "RESET" button. If you enter any value there (no matter what), all your one-way-switches will be reset to the initial state. As long as that value remains in C1, they will respond to every change of their inputs. If you then remove the value from C1, they will again become one-way-switches.


Excel 2010
ABC
120
231
340
450
560
Sheet1
Cell Formulas
RangeFormula
B1=IF(ISBLANK($C$1),IF(A1<>3,MAX(0,B1),MAX(1,B1)),0)
B2=IF(ISBLANK($C$1),IF(A2<>3,MAX(0,B2),MAX(1,B2)),0)
B3=IF(ISBLANK($C$1),IF(A3<>3,MAX(0,B3),MAX(1,B3)),0)
B4=IF(ISBLANK($C$1),IF(A4<>3,MAX(0,B4),MAX(1,B4)),0)
B5=IF(ISBLANK($C$1),IF(A5<>3,MAX(0,B5),MAX(1,B5)),0)


J.Ty.
 
Upvote 0
J.Ty,

Are we getting our communications crossed?

("businessbee123" likes your response.)

The solution you provided me is a good one. I only had a follow up question regarding using a 'Date' rather than a "1".

Regards,

Phil Payne

Dear Phil,

I understood that you explicitly didn't want any method of reversing the change from 0 to 1.
In the following example cell C1 is a special "RESET" button. If you enter any value there (no matter what), all your one-way-switches will be reset to the initial state. As long as that value remains in C1, they will respond to every change of their inputs. If you then remove the value from C1, they will again become one-way-switches.

Excel 2010
ABC

<colgroup><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]1[/TD]
[TD="align: right"]2[/TD]
[TD="align: right"]0[/TD]
[TD="bgcolor: #FFFF00, align: right"][/TD]

[TD="align: center"]2[/TD]
[TD="align: right"]3[/TD]
[TD="align: right"]1[/TD]
[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]4[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]
[TD="align: right"]5[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"][/TD]

[TD="align: center"]5[/TD]
[TD="align: right"]6[/TD]
[TD="align: right"]0[/TD]
[TD="align: right"][/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Worksheet Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: #DAE7F5"]
[TH="width: 10"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B1[/TH]
[TD="align: left"]=IF(ISBLANK($C$1),IF(A1<>3,MAX(0,B1),MAX(1,B1)),0)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B2[/TH]
[TD="align: left"]=IF(ISBLANK($C$1),IF(A2<>3,MAX(0,B2),MAX(1,B2)),0)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B3[/TH]
[TD="align: left"]=IF(ISBLANK($C$1),IF(A3<>3,MAX(0,B3),MAX(1,B3)),0)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B4[/TH]
[TD="align: left"]=IF(ISBLANK($C$1),IF(A4<>3,MAX(0,B4),MAX(1,B4)),0)[/TD]
[/TR]
[TR]
[TH="width: 10, bgcolor: #DAE7F5"]B5[/TH]
[TD="align: left"]=IF(ISBLANK($C$1),IF(A5<>3,MAX(0,B5),MAX(1,B5)),0)[/TD]
[/TR]
</tbody>[/TABLE]
[/TD]
[/TR]
</tbody>[/TABLE]



J.Ty.
 
Upvote 0
Phil,

What date do you mean?

J.Ty.
 
Upvote 0
With VBA we could enter the date into a cell by using - .Value = Date - which is the date an event occurred.

This date would not change as the days past.

I've tried putting date in your formula so that the result is DATE instead of 1 with no success.

Can this be done?

Phil,

What date do you mean?

J.Ty.
 
Upvote 0
I see now.

Perhaps you want the formula to record the date when certain cell becomes 3 and remain unchanged since then. Am I right?


J.Ty.
 
Last edited:
Upvote 0
Phil,

Here it is, together with the "Reset" button. I used NOW() for testing, which gives the date and time, you can change it to TODAY(), which gives the date, only.

J.Ty.


Excel 2010
ABC
1317:24:41
Sheet1
Cell Formulas
RangeFormula
B1=IF(ISBLANK(C1),IF(A1<>3,B1,IF(B1="",NOW(),B1)),"")
 
Upvote 0

Forum statistics

Threads
1,223,243
Messages
6,170,971
Members
452,371
Latest member
Frana

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