Questions tagged [conditional-statements]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
42 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
25 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
31 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
67 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
269 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 ...
0
votes
0answers
11 views

Identify pseudo-duplicate rows with conditionals

I want to write a function that identifies rows that are "pseudo-duplicated" in my dataset, and returns unique values and de-duplicates applicable records. The rules for a pseudo-duplicated row are: ...
3
votes
2answers
72 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
54 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
52 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
63 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
34 views

Highlighting cell using if condition

Here is my excel sheet: ---------------------------------------------------------------- | | A | B | C | D | E | ----------------------------------------------...
1
vote
0answers
32 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
828 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
28 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
267 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 ...
2
votes
2answers
4k 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
28 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
34 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
96 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
108 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
714 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
778 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
52 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
49 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
122 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
3k 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
151 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
171 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
776 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
117 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
396 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
231 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
11k 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
50 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 ...
2
votes
1answer
151 views

Bash Regex oddity when using =~ operator

Consider this code: s1="1,2,3,4"; \ s2="1,2,3"; \ sP='^(([1-9][0-9]{0,},){1,2}){1,2}$'; \ [[ "${s1}," =~ $sP ]] && echo "\$s1 matches"; \ [[ "${s2}," =~ $sP ]] && echo "\$s2 matches,...
0
votes
2answers
4k views

Need help to hide/show excel rows based on value in a cell, but allow for moving rows around later

In Row 4 I ask a question and D4 will contain the answer of either Yes or No. If the answer is Yes in D4, I want hidden rows 5 and 5 to appear with follow-up questions. This is working for me: If ...
3
votes
2answers
41k views

Multiple IF statements and concatenation in Excel

So far I've managed to concatenate cells I1 and J1 with the words "From" and "To" and put them on separate lines using: =CONCATENATE("From: ",I1," ","To: ",J1) I've also managed to populate column L ...
5
votes
4answers
18k views

Using a wildcard in a condition to match the beginning of a string

Trying to have a variable meet a string of text that varies by length. The part of the string that matters is the first couple of characters. var1=hello if [ $var1 == hello ]; then echo ...
1
vote
1answer
687 views

Excel rearrange column using copy + paste

I am trying to create a method to automatically rearrange the column when performing copy + paste. Say I have an excel file with table containing columns on the first row: ID | NAME | DATE | ...
2
votes
2answers
246 views

Vector Compare to Scalar

Is it possible to compare a vector of values to a single scalar value in Excel? Example: =IF(A1:Z1 > 0, 1, 0) Typically, I've seen the following: =IF( AND( A1>0, B1>0, C1>0, . . . Y1&...
1
vote
0answers
776 views

Mail Merge Multiple IF Conditions for cell

I have a conditional statement for two cases (and default) which works fine. This is simply to enter a cell value based on another cell value in an earlier column simplified and shorm of extraneous ...
1
vote
2answers
121 views

Excel: conditional COUNTIF?

How can I evolve =COUNTIF(A:A;"foobar") so that if the cell in column A is empty, it looks (for the "foobar") in column B?