IF false Do Nothing

philipad

New Member
Joined
Jan 14, 2009
Messages
12
Hi all,

The IF function has the following syntax:

IF(logical_test,value_if_true,value_if_false)

My questions is,
If I don't want the function to take any action in the case of the logical test is false, what do I write in the "value_if_false" field?
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Hi,

Just type "" , in the value is false.

=if(A1=1,"yes","")

False will then return nothing.

Thanks

Thanks for the reply

This doesn't work for me because it does perform an action. It writes "" into the cell. What I want is to do nothing, that means i something was in the cell it should be unaffected.
 
Upvote 0
Spreadsheet formulas don't "take actions", they return values.
What value do you want returned if the condition is false?
 
Upvote 0
Spreadsheet formulas don't "take actions", they return values.
What value do you want returned if the condition is false?

Ok I will start over...

Today is Saturday 01/17 and I write down in cell A1 the value 50.
In my worksheet I have a list with dates and number 50 will be written next to today's date.

For this I use a logical test, which compares which date from the list is today's date. IF(B1=today(),C1=A1,"do nothing")

Tomorrow I want to write in the same cell (A1) some other number lets say 100. Now the C1 cell already has its value (50) from yesterday. As the above logical test will return FALSE (because now it s Sunday), I dont want any changes to occur to the C1 cell
 
Upvote 0
What would be the VB code to do this?
Thank you

This prompts for an input then searches column A for today's date and if found puts the value in column B.

Code:
Sub test()
Dim X As Variant, F As Range
X = Application.InputBox("Enter Value")
If TypeName(X) = "Boolean" Then Exit Sub
Set F = Columns("A").Find(what:=Date, LookIn:=xlValues, lookat:=xlWhole)
If Not F Is Nothing Then F.Offset(, 1).Value = X
End Sub
 
Upvote 0
What would the VB code be if I had the following:

Mar 100
Apr 200
May 75
June 80
July
Aug
Sept

Current Month July
Amount 75

I would like July to have 75 and keep the other months the same. In Aug, I would change the current month to Aug and put the new amount in the amount section and Aug would update with that new number. The other months would not change.
 
Upvote 0

Forum statistics

Threads
1,216,105
Messages
6,128,859
Members
449,472
Latest member
ebc9

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