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?
 
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

I'm working in excell 2013 and this is almost EXACTLY what I need. I'm trying to search for assets with the same name in two sheets (vlookup) and input the number from the column next to it if found. Leave alone if not found.

In other words I have a list of asset names and number of time those assets have been viewed in a master sheet (MS). Each week I get a list of updated views on assets in a second sheet, updated sheet (US). I want to search the US for assets that may be in the MS and update the number of times they've been viewed in the MS. However those assets don't always appear in the US so if there is no update I want it to remain as it was.

Can anyone help?
 
Upvote 0

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
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?

** I needed something similar. I used =IF(A3=DATE!$S$2,GETPIVOTDATA("Due?",'Needs'!$A$6),B3)

So basically if A3 (Date in table) = Data Date, then use X number from my pivot, if not then B3. B3 being yesterdays data.
 
Upvote 0
=if(a1<0,"-",a1)

This is a necro post, but this is the best answer out of everyone here. I figured this out in a few seconds, too. Surprised to see that others didn't figure this out, or even realize that this is the best answer.

It's not technically doing nothing, per se, but it goes around the issue by essentially doing the same thing, by saying "if false, then whatever's already in A1 should be 'added' so that it's the same result as A1".
 
Upvote 0
You might want to reread the question, since that doesn't actually address it, at least not as written. The only way it would be an answer is if you turn on iteration and enter it in the cell you don't want changed.
 
Upvote 0
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?


hello, it's a bit late I know :) .But I've found what you ask.

Let's assume there are random numbers and we want to reflect the word "bingo" if there is 10 in the given numbers and remain same if not.
if you write the function ' =IF(X3=10;"bingo";$X3) ' where x is the column of the random number and 3 is the row of the first number (if the numbers go downward). Excel understands this code as take x column as constant and changes the row for the each run. So, since we write $X3 as the else part of the if function, It'll remain same.
 
Upvote 0
hello, it's a bit late I know :) .But I've found what you ask.

Let's assume there are random numbers and we want to reflect the word "bingo" if there is 10 in the given numbers and remain same if not.
if you write the function ' =IF(X3=10;"bingo";$X3) ' where x is the column of the random number and 3 is the row of the first number (if the numbers go downward). Excel understands this code as take x column as constant and changes the row for the each run. So, since we write $X3 as the else part of the if function, It'll remain same.

No, it does not.

Relative addressing (the $'s) has nothing to do with iteration. It has to do with where a formula, when copy pasted or dragged to different cells, gets its inputs.

If the = X3 is dragged right and down, both the X and the 3 will change. =$X3 will only change the 3, =X$3 only the X =$X$3 neither.

A spreadsheet is a very NOW object. It doesn't "think" in terms like "a cell has changed, therefore I do ...."
It "thinks" like "this cell contains this, that cell contains that, therefore the other cells contain...". When the user changes this or that, it goes through that same process without any memory of what has happened before.
 
Upvote 0
there is a way
here is what i did:

=IF(COUNTIF(Table1[Lésion];Statistiques!O6)=0;"";COUNTIF(Table1[Lésion];Statistiques!O6))
 
Upvote 0
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?
If you refer back to the cell you are writing the IF statement for the false value, only the IF true statement will cause a change, and if you "do nothing", as in, for any other condition than the true statement, the cell will remain the same.

For example, I have just written a statement for a reference box, where I wanted to change an abbreviation to full text, but for any other info in this box to remain the same.

If I do =IF(E15="RTU","Ready to use",E15), all other values within the cell (other than RTU), will be displayed as they are written into E15. The false value becomes whatever else is written in this cell.
 
Upvote 0
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?
I know this is way old, but what you want to do is have it reference the cell itself. Have if true run your updating value and once it's false it will no longer update but keep the last known value. I believe you do have to go to file, options, formulas and click enable iterative calculations for this to work. I currently run several formulas like this as well as an automatic date function. I enter in a description and amount and It will automatically put the currently date for me. Hope this helps someone
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?
 
Upvote 0

Forum statistics

Threads
1,216,102
Messages
6,128,852
Members
449,471
Latest member
lachbee

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