Questions tagged [if-statement]
An "if" statement is a flow control structure in most programming languages that branches execution flow depending on a binary condition, generally evaluated at runtime. If statements are also commonly also called conditionals. When using this tag please also include an appropriate language tag, such as e.g. "java" if your question is language-specific.
if-statement
62,215
questions
0
votes
1
answer
32
views
Excel Formula for Today's Month Being Greater Than Lookup Value Month & Provide Message
I have created a budget sheet in Excel to track Debt Snowball payments. I have a formula that successfully works to lookup the month from a list of months (column F) that a final payment is made for a ...
0
votes
0
answers
6
views
Arrayformula with IF function in Google Sheets
I am trying to array a formula with if function but I am getting circular dependency error.
Sample Data
I want to copy dates from column A to B using formular =IF(D2="","", IF(A3=&...
-2
votes
0
answers
33
views
Angular 18 responsive [closed]
HI create the responsive header button with Angular 18 with below code. It alway return false. I don't know how. Could you help me.
the handsetView$ returns the object like {screen: "sm", ...
1
vote
0
answers
65
views
exit status of if statement in bash when condition is false
If I run help if in bash then it tells me that the exit status is "the status of the last command executed". Let's try it:
if false; then
echo we never get here
fi
echo $?
The last ...
0
votes
0
answers
35
views
saving results according to conditions
I am trying to take the specific data I need from the loaded excel file,
I entered the conditions, where in the first condition it pulls out the cell, the cell where 'Entrance (number) Floor' is ...
-5
votes
1
answer
78
views
Using "not" (!) to precede a method in Java on a conditional? [closed]
I have the following conditional statement in Java and would appreciate some insight on the purpose of using "not" (!) on a method in the conditional in such a manner:
char[] buf = new char[...
0
votes
0
answers
46
views
Entered too many arguments for this function
I am having a problem where I am unable to find out the issue with my formula in Excel. Everything worked fine until I added an additional argument to the string, but I do not see any erroneous commas ...
-2
votes
1
answer
58
views
How can I run If statements on every sheet that contains specific text using VBA?
I am trying to create a macro that will run If statements on every sheet with "(M)" at the end. I just need the macro to check cell "G8" in every worksheet with "(M)" at ...
-2
votes
0
answers
41
views
The Else block is not running is any case in python [duplicate]
I am using if else block for conditioning the execution as follows:
is_initialized = False
def process_interaction(prompt, is_initialized):
# No need for global flag
if is_initialized == False:
...
0
votes
1
answer
56
views
Await inside if block not waiting
I am loading some data from a DB table using sequelize and caching it in an in-memory object with a TTL so I don't keep reading from the DB over and over again.
// ffm.ts
import { Op } from 'sequelize'...
1
vote
3
answers
78
views
Excel Column to Count Unique Values
I have a list of names in a column in excel. The names are duplicated many times in the data. I want to create a new column that will put a 1 for each time a name first appears and 0’s after that. My ...
-1
votes
0
answers
31
views
Using if statement in a batch file [duplicate]
My "if" statement doesn't work. I receive the value from user using the following command:
set /p MAP=Enter map filename:
Then I use "if" to do some work:
:mylabel
if %MAP% neq &...
0
votes
3
answers
52
views
If ... else : the condition has length > 1
I am trying to classify variants according to their type (polymorphisms, insertion or deletion). Here is a snippet of my input :
A T
G C
T AG
C T
TT C
AT CC
Here is the dput output, if you need ...
1
vote
1
answer
41
views
SAS how to use character variable in if statment
I want to use character variable for if statement comparison, however why SAS always trying to treat it as numeric?
let VAR = "apple"
other code...
%macro Exec_day1();
If &VAR. eq &...
0
votes
1
answer
18
views
How if condition works in SAS background?
How do if works if i write the code below:
data B;
h= 1;
D="M";
run;
data c;
set b;
length nn $30;
type = vtype(H);
if type eq "N" then nn=put(h,best.);
else if type eq ...