Questions tagged [conditional-statements]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
3 answers
47 views

IF statements excel help referring to multiple cells

I am struggling a bit with my IF statement and was wondering if I can get some help. I made a new column and want to have it filled based on three other cells. For example, you can see the attachment ...
user avatar
1 vote
1 answer
29 views

Is it possible to link an entry in a filtered sheet to the master sheet, matched on a key variable? (Excel)

I am trying to link a column in a filtered sheet to another column in the master sheet using a key category (i.e., id). Below is the illustrated dataset: [] As shown above, I have the master sheet, ...
user avatar
0 votes
1 answer
51 views

How to conditionally merge tables in Excel

I have two tables of data in Excel that were exported from our HR system. One contains estimated/planned workhours, the other contains actual worked hours. Each line has a date, hours worked, and the ...
user avatar
1 vote
2 answers
76 views

getting Max/Min value in range based on a cell's condition

Greetings to all Excel gurus.. I've got the dataset shown in the image attachedenter image description here.. I'd like to show the MIN and MAX value of "Price/Oz" based on the condition if ...
user avatar
0 votes
1 answer
37 views

Using conditional formatting to highlight cells that exceed the criteria below

I'm working on a spreadsheet that lists width of a product in cell A, and height of a product in cell B. I'm trying to apply conditional formatting to highlight these cells if they surpass the limits ...
user avatar
1 vote
1 answer
662 views

Using conditional filters in FFmpeg

It blew my mind when I recently came across something new about FFmpeg despite having used it for years - the fact that it comes out of the box with advanced conditionals like if statements and lt/gt ...
user avatar
  • 10.6k
2 votes
4 answers
140 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 ...
user avatar
  • 10.6k
0 votes
0 answers
169 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 ...
user avatar
  • 101
0 votes
2 answers
26 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 ...
user avatar
0 votes
1 answer
51 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", ...
user avatar
1 vote
0 answers
22 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))
user avatar
0 votes
1 answer
33 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 ...
user avatar
0 votes
1 answer
68 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 ...
user avatar
1 vote
3 answers
257 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 ...
user avatar
7 votes
1 answer
7k 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 ...
user avatar
0 votes
1 answer
32 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 ...
user avatar
0 votes
1 answer
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 ...
user avatar
3 votes
2 answers
803 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 ...
user avatar
  • 167
0 votes
2 answers
202 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 - ...
user avatar
0 votes
1 answer
59 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 ...
user avatar
0 votes
1 answer
83 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 "...
user avatar
0 votes
1 answer
43 views

Highlighting cell using if condition

Here is my excel sheet: ---------------------------------------------------------------- | | A | B | C | D | E | ----------------------------------------------...
user avatar
1 vote
0 answers
37 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 ...
user avatar
  • 11
-1 votes
2 answers
2k 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 ...
user avatar
0 votes
1 answer
14 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 ...
user avatar
  • 125
-1 votes
1 answer
30 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, ...
user avatar
  • 1
1 vote
1 answer
489 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 ...
user avatar
4 votes
2 answers
12k 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 [[ $...
user avatar
1 vote
0 answers
36 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 ...
user avatar
0 votes
1 answer
23 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 ...
user avatar
0 votes
1 answer
41 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 ...
user avatar
-2 votes
1 answer
39 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 ...
user avatar
  • 33
1 vote
2 answers
179 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 :...
user avatar
  • 1,193
1 vote
0 answers
165 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 ...
user avatar
  • 64.9k
0 votes
1 answer
752 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 == ...
user avatar
2 votes
1 answer
1k 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 ...
user avatar
1 vote
1 answer
57 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 ...
user avatar
1 vote
1 answer
80 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 ...
user avatar
1 vote
1 answer
58 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 ?
user avatar
0 votes
1 answer
127 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 ...
user avatar
  • 1
0 votes
2 answers
7k 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 ...
user avatar
1 vote
1 answer
168 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 ...
user avatar
0 votes
0 answers
219 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=...
user avatar
  • 251
1 vote
1 answer
956 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 ...
user avatar
  • 133
-1 votes
2 answers
122 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 ...
user avatar
  • 203
0 votes
0 answers
71 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 "...
user avatar
  • 1
1 vote
4 answers
43 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 ...
user avatar
  • 23
1 vote
2 answers
610 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 ...
user avatar
  • 11
0 votes
1 answer
2k 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 ...
user avatar
  • 111
0 votes
1 answer
348 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....
user avatar