Questions tagged [nested-if]

This tag refers to a code structure in which multiple if-statements are placed in a "nested" form (i.e. one if-statement is contained within another).

Use this tag for questions related to constructing, maintaining, or refactoring nested if-statements.

428 questions
2
votes
1 answer

Arrayformula Int

How would I adjust this formula to not expand to infinity, but only expand if the adjacent row contains a value? =ARRAYFORMULA({"Invoice Date"; INT(B2:B)}) thanks!
2
votes
2 answers

Google Sheets: Determining if a time falls within a two specified times

I'm trying to find a way to determine if a time falls between two specific times - with two different scenarios to flag. So far, I'm coming up empty (and frustrated!) Column B has date/times such as: February 9, 2022 09:55AM February 9, 2022…
HiDrew
  • 25
  • 4
2
votes
1 answer

nested if v/s && operator

I am writing code in C++ for checking if a cycle is present in a given undirected graph or not. My code is this:- #include using namespace std; // Class for an undirected graph class Graph { // No. of vertices int V; …
Utsav
  • 23
  • 3
2
votes
1 answer

Can I use SQL CASE statement inside GoogleSheets QUERY?

How can I (or is it possible?) use something like CASE statement in T-SQL inside QUERY in Google spreadsheet? I want to do something like this: =QUERY(A6:AI,"select A,(CASE WHEN D>2.5 THEN 'Yes' ELSE 'No' END),E,C,J") I want basically a custom…
2
votes
3 answers

Google Sheets ARRAYFORMULA to skip blank rows

How to make my ARRAYFORMULA(A1 + something else) to stop producing results after there are no more values in A1 column, eg. to skip blank values. By default it gives endlessly "something else". Here is my demo…
2
votes
1 answer

Getting an formula parse error on a basic if statement

I am trying to use IF statement in a Google Sheet, but whatever I am typing in the IF I am always getting a formula parse error. Do I have to activate something, or am I missing something ? A1 & B1 have the same type (integer) I have no idea…
2
votes
1 answer

How to check if any of the time ranges overlap with each other in Google Sheets

I found a thread already with the same question: How to calculate the overlap between some Google Sheet time frames? But I tried the same formula, altering it to match the ranges in my google sheet but it is not working. Here is my google…
2
votes
3 answers

google sheet : How to vlookup by matching value in between max and min?

I have 2 sheets like this : In that 2nd sheet, i want to lookup the id (S/M/L/XL) by checking if value is in between the Min value and Max value. So the goal is to have something like that 2nd sheet where in 'level' column, i need to put a formula…
andio
  • 1,574
  • 9
  • 26
  • 45
2
votes
1 answer

Simplify nested if-else structure using the most suitable data structure

I have a nested if-else block, where a series of conditions are present which need to be executed in a particular order. Below is a sample of the code. Map DataHashMap = new HashMap<>(); String SPECIES = "SPECIES"; …
Dawson Smith
  • 473
  • 1
  • 6
  • 15
2
votes
1 answer

How can I only run a calculation in Google Sheets, if the cell is not empty?

basically, I'd like to get the percentage differences between two numbers, but only if there is data/numbers in those cells. I don't want the formula to run if there is not any data in the cell, as this will give me a div error.
2
votes
0 answers

R Shiny: Reactive DF, filtered according to a reactive nested IF statement

I am trying to create an app that takes an input file and allows users to filter it by applying multiple conditions and picking keywords to look for in selected columns. The filtering logic: Enter keywords (separated by comma) in textInput widget;…
denisafonin
  • 1,116
  • 1
  • 7
  • 16
2
votes
1 answer

undefined output from Income Tax Calculator. JavaScript

this is an exercise from Murach's Javascript and Jquery book. An income tax calculator. The code is pretty self explanatory. The error: undefined is popping up where the value of the tax owed should be. commented out if statement outputted the same…
Ace
  • 59
  • 1
  • 7
2
votes
3 answers

"Cleaning up" nested if statements

In a console program I am creating, I have a bit of code that parses through a file. After parsing each line, it is checked for syntax errors. If there is a syntax error, the program then stops reading the file and goes to the next part of the…
2
votes
6 answers

How should I use nested ifelse statements?

I have created a data frame with the following data name <- c("A","B","C","D","E","F","G","H","I","J") age <- c(22,43,12,17,29,5,51,56,9,44) sex <- c("M","F","M","M","M","F","F","M","F","F") rock <- data.frame(name,age,sex,stringsAsFactors =…
Sayam Nandy
  • 87
  • 1
  • 2
  • 10
2
votes
1 answer

Nested "If-else" statements in CodeEffects rule

I am using CodeEffects rule editor for writing business rules in our application. I have many if-else conditions which are actually nested-if type rules. With no support of nested-if, I need to re-write all if conditions every time. But I can't find…
1 2
3
28 29