Questions tagged [conditional-statements]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
4answers
133 views

How to rewrite a wall of if-elif statements

For cigs.sh - the complete script can be found here - I wrote the following ugly (but perfectly working) logic to print and format the script's output, partly just to figure out all the edge cases but ...
0
votes
0answers
58 views

Excel VBA - Loop to Compare Cells, Offset entire row

Hopefully someone can help me with this! Just started learning VBA. I am trying the following code. The aim is to compare cells in rows starting from row 4 to and offset entire row up or down based on ...
0
votes
2answers
20 views

How do I set up conditional content in excel based on multiple columns?

I'm working on a database for magic items for my d&d campaign, compiling several books and homebrew stuff into 1 file. I have a list of prices based on the rarity of the item and whether or not it ...
0
votes
0answers
19 views

How to switch profiles in MPV depending on what system is used?

After reading documentation it's clear that I just need to write correct --profile-cond. But I can't understand how to check if Windows or X11 is used.
0
votes
0answers
28 views

Copying names from one sheet to another based on 1 of 6 criteria in another cell

I have a google sheets workbook with 3 tabs. 1st tab is the main tab I'm pulling from I have a column for names and a column of states the users are from. 2nd tab is for all users from the West and ...
0
votes
1answer
44 views

attempting Pass or Fail result based on a several cells meeting numeric criteria. “too many arguments for this function”

Here is the IF statement that is generating the error: =IF(B3<=B2, "Pass","Fail", IF(D2>=0, "Pass","Fail", IF(E2>=1,"Pass","Fail", ...
1
vote
0answers
20 views

SUM IF with multiple conditions in the same collumn

How to make this work in libre office Calc? =SUM(SUMIF(Aug.N$2:N$400, {"ED","EDS","CS"},Aug.AD$2:AD$400))
0
votes
0answers
58 views

HOW TO SIMPLIFIED AN EXCEL FORMULA

Here is the formula that I use but there is an error made, idk where to adjust. May I need help from anyone to correct this or simplified this formula? =IF(AND(A2=0,B2=0,C2=0,D2=0,E2=0,F2=0,G2=0),&...
0
votes
1answer
25 views

How to make text appear conditionally based on form input in MS Word?

Is it possible to create a fillable form in MS Word where text appears conditionally based on what the user inputs in the form? For instance, if the user selects Option 1 from a Drop Down List, I want ...
0
votes
1answer
52 views

Copy cell data from one worksheet to another worksheet only if both worksheets unique value matches

I'm new to excel & i'm hating so much but it's uses are vast. Now for my query I've a workbook containing three sheets 'Project A' , 'Project B' & 'Project C' Project A & Project B as ...
0
votes
0answers
30 views

Excel: IF Statement with 3 AND Conditions

I'm trying to get an IF statement for the 3 logical tests in the example below but it isn't working: =IF(AND(B2="Unique",C2="1",D2="2"),"Y","") B2 is ...
1
vote
3answers
62 views

Counting unique values against a subset of a list

I'm trying to count how many unique supervisors a particulate employee has. (See an example data set below.) I'm able to do this in a round about way, but I'm wondering if any of you experts out ...
2
votes
1answer
2k views

Comparing two strings in zsh

I've been looking everywhere for what should be a simple example. First time trying to script something for zsh now that MacOS has switched over to it as default - how do I compare two strings in an ...
0
votes
1answer
29 views

I can't tell why my IF statement is producing false result

=IF(0<VLOOKUP($A9&$E9,'All Orders Avg'!$Q:$S,3,FALSE)<1,1,VLOOKUP($A9&$E9,'All Orders Avg'!$Q:$S,3,FALSE)) The IF Statement is supposed to find values between 0 & 1 and round them ...
0
votes
1answer
2k views

Disable certain drop down list selections based on another cell

Let's say that in column A, users enter in different numbers. In column B, there are options of Y or N. If column A has a cell with the value of zero, it should disable the "N" option in column B. How ...
3
votes
2answers
148 views

Write a formula for “If Cell 1 contains a keyword, Then Cell 2 changes background color”

I have a list of pages in column A. I want certain cells in column B to be highlighted if the cell B1 contains the word Hotel. See below example where cells B2, B5, B8, and B10 have a background color ...
0
votes
2answers
109 views

Using AVERAGEIF() over a range of years

I have a dataset that includes year, country, and population data. A small condensed sample is below. I am trying to write an excel statement that would calculate the average population from 1980 - ...
0
votes
1answer
55 views

Condition in bash script

I want get [4 file name string] from user and pass these parameters to bash script. script should copy files in user home directory. FYI: each file might be exist or not, might be one of them exist or ...
0
votes
1answer
71 views

What's wrong with the batch file?

A very annoying error in my batch program causes it to stop. I'm sure it's somewhere in the IF statement but I'm a beginner and I can't find anything on the web so I came here :englog CLS set/p "...
0
votes
1answer
36 views

Highlighting cell using if condition

Here is my excel sheet: ---------------------------------------------------------------- | | A | B | C | D | E | ----------------------------------------------...
1
vote
0answers
34 views

Hide, Show and Replacing PDF form content blocks with multiple fillable fields

I am trying to build a single fillable PDF form that provides hiding/showing/replacing of context-specific signature blocks containing multiple fields, after selecting a radio button. Ideally, when a ...
-1
votes
2answers
1k views

Excel over 100% then = 100%

I am calculating percentage and currently I have cells with the formula =IF($H4="3PL",L4/Data!B$24,L4/Data!B$21) I need to add a second piece: If the answer of above is greater than 100% make it ...
0
votes
1answer
12 views

Optimize code to check a Data Validation cell to pick another cell

I have cell E2 that contains a Data Validation group: "online", "article", "journal", "proceedings" and "magazine". I am populating cell K2 with a formula that is based on E2's entry. If I select an ...
-1
votes
1answer
29 views

Nested IF and AND Statement for a range

Here's what I'm trying to accomplish: I have a cell, U5 which has a value between 2-18 ... If U5 < 6, assign a 1 If U5 is >5 but <9, assign a 3 If V5 is >8 but <15, assign a 6 If V5 is >14, ...
1
vote
1answer
330 views

TCL/Expect script with if/else logic based on host IP address

So I have been using and enjoying /usr/bin/expect for scripts because it can quickly log me into servers since it autocompletes my userid and password. Through some cursory reading, I've come to ...
4
votes
2answers
8k views

How does bash test 'false'?

$ false $ echo $? 1 $ if [[ false ]]; then echo 'do it'; fi do it $ test false && echo 'do it' do it $ COND=false $ echo $COND false $ if [[ $COND -ne 0 ]]; then echo 'do it'; fi $ if [[ $...
1
vote
0answers
33 views

Preserve Styles in Microsoft Word 2016 Conditional Text

I have an MS Word document from which I need to create 2 subdocs for internal/public audiences. I am using the IF field to condionalize the master doc. In one section, the "truetext" contains a few ...
0
votes
1answer
20 views

Is there a better way to accomplish this? Excel copy-pasting using conditional statement based on formatting conditions of the cells above and below

How can I achieve the after where the dates are copied next to the appropriate expenses without having to manually copy paste? I guess the logic is that all the charges copy the date before them which ...
0
votes
1answer
35 views

Run command only on certain files in subfolders, depending on other files

I've got a folder called Music, that has subfolders of different artist, containing a whole lot of .flac files. I'm trying to convert all of them into the .wav file format and then convert them to ...
-2
votes
1answer
38 views

I'm trying to return the results of one of the if statements, but I am only able to get True/False results? [closed]

=IF(OR(AND(C11=1,(B13+3+(VLOOKUP(C15,'Locks and Readers per day'!A:B,2,FALSE)))), AND(C11=2,(B13+3+(VLOOKUP(C15,'Locks and Readers per day'!A:C,3,FALSE)))),(C11=3,(B13+3+(VLOOKUP(C15,'Locks and ...
1
vote
2answers
133 views

Can I implement IF EXIST with a given file extension?

I'm in the process of making a batch script to autoexecute a program if a given file type (in this case specifically *.iso) is found. Here is the current direction I'm headed: IF EXIST *.iso GOTO :...
1
vote
0answers
138 views

Ignoring /substituting missing certificate files in apache 2.4 config

Are there any directives or constructs I can use in Apache 2.4 to prevent Apache from failing to load at all if a certificate file is missing for an https Virtualhost is missing. (I am dealing with a ...
0
votes
1answer
739 views

how to use Jenkins conditionals?

I have a flow inside a simple project, I want to do the following if the day is Saturday I want to run job A else I would like job B to run, schematically like this: DAY = $(date+"%A") if($DAY == ...
2
votes
1answer
923 views

Sending specific email based on cell values in Excel 2016?

Is there a more efficient way to send email reminders to a user based on a cell value that changes frequently? Here's the code of what I'm working on so that you guys could understand the context of ...
1
vote
1answer
53 views

Excel: Identify Cells with Duplicate Value in One Cell, and Equals 0 in the Next Cell

I am trying to remove inactive print queues from a print server. Each printer has a separate queue for each tray. The catch is that I only want to remove queues which have no activity on any of its ...
1
vote
1answer
57 views

Excel 2016: to find the first occurance of a value in a vector

I have a vertical vector (see below) and I am looking for a function where I can search for the first occurance of the "1" or a "2" or a "3". If I find the first "1" I would add a value to a cell and ...
1
vote
1answer
56 views

Excel 2016 conditional statement in combination with an OR?

Is it possible to combine a conditional statement w/ BOOLEAN OR, like: =IF(x=1 OR 2) do x o/w do y ?
0
votes
1answer
124 views

EXCEL 2016 VLOOKUp or conditional statement?

The aim is to compare a halogen light bulb with a LED bulb to find out which technology is cheapest in the long run. I want to check when a Halogen bulb burns out during the year. The "lifetime" is ...
0
votes
2answers
4k views

Excel - If two cells are greater than 0, than return the cell that is greater, if only one cell is greater than 0, than return that value

I have been trying to figure this out for a while now but I'm stuck on the [value_if_false] part and I feel like it's really simple but it's not coming to me. So basically, trying to display the ...
1
vote
1answer
156 views

Vba Excel : using OR column condition without duplicating row

This is an updated version for this. The above solution is good, until I realized when I put in massive data, the for loop generates duplicate rows (which unwanted results) I found some method ...
0
votes
0answers
186 views

Why is bash using -ge to compare instead of ==?

So I'm looking at adding a low hard drive space warning to my home server. I like the look of the following which comes from here: ADMIN="yourmail@example.com" # set alert-level 90 % standard ALERT=...
1
vote
1answer
857 views

How to use if statement in batch file?

I have the following for loop in my batch file: for /f %%y in ('findstr /C:"%%c" out.txt ^| sed "s/.*%%c \([^>]*\).*/\1/i"') do SET RESULT=%%y echo.%%a;%%b;%%c;!RESULT!>>D:\outputTA.txt My ...
-1
votes
2answers
120 views

How do I set up a conditional formula with multiple criteria?

I recently needed to find matches occurring anywhere within a column. This article here How to identify cells in Column A that contain any of the values in Column B gave me exactly what I needed to ...
0
votes
0answers
68 views

How do I externally reference rows from one sheet to another based on a non-numerical condition in one column no the original sheet?

I currently have a large list of product information on a sheet in an Excel workbook. I want to copy and paste certain rows of data - the whole row - to a new sheet based on a certain column (all the "...
1
vote
4answers
41 views

Load condition within execution line in Bash

I want to execute a command with an option that depends on the attribution of a variable. If the variable is set, load the option with the value, but if not, don't load that option. This is what I ...
1
vote
2answers
541 views

Conditionally add images to bubble chart? [closed]

I need to mass produce bubble charts for a large set of peer groups, where each chart shows anonymized peer group data but highlights the group of interest with their team logo. I'd like to automate ...
0
votes
1answer
1k views

how diff command behaves on if statement in shell script

I have tried following code.. if diff f1.sh f2.sh; then echo Same else echo Different fi Here.. In my case both f1.sh and f2.sh are different files.. So if statement prints Different(as ...
0
votes
1answer
294 views

Is is possible to set the “expires” time based on “creation” time?

After using Keepass for several years, an idea came to me that would be nice to implement. There are over 300 records in my database, and it would be nice to know which of those records are still good....
0
votes
1answer
12k views

If Function is not working in Excel

I had made a sheet to calculate factory workers timing and payment against working and over time. First I made it in Excel 2013 and then I changed my Windows from 10 to 7 and also changed the ...
1
vote
1answer
52 views

Delete every row that doesn't contain a blank

I need to delete every row in Excel that does not contain a "blank" value in one of its six columns. I tried sorting each column, but there's 100k+ rows and that method really only works if I'm ...