430 questions
0
votes
3
answers
65
views
Excel - multiple IF conditions
I am trying to write a formula or function which looks for certain key words in one column and based on keywords, assign owners in another column.
Something like
If G4 contains switch or router or dir ...
0
votes
1
answer
58
views
How to end an 'If' statement nested in a 'For Each' loop in VBA? [closed]
I'm trying to spread a budget overspend into budgets that have underspent. Currently, my method is to loop through each row and fit negative values into positive ones.
My code is giving me a "...
2
votes
4
answers
94
views
Find hierarchical shareholders relationships: refactor nested if in Python
I want to find shareholder relationships between companies.
In the below example, 'Person 1' has directly 50% of 'Company 1' shares, and then we need to check if 'Company 1' also have shares of other ...
0
votes
9
answers
252
views
What is a simpler/more readable alternative to this code structure? [closed]
There been many times lately where a C++ exercise has required me to do perform operations dependent on the relation between elements in a vector. For example to do x only if the next element in the ...
0
votes
1
answer
330
views
Alternative for Nested If in PowerApps
I'm new to PowerApps, and I need help in simplifying a code. Would appreciate if someone could help, and thanks in advance. The code that I have now is working under nested if, but its too long. So I ...
-1
votes
1
answer
50
views
Sum Function in MS Excel [closed]
[=IF(I74<=50000,"150",IF(I74<=100000,"200",IF(I74<=150000,"250",IF(I74<=200000,"300",IF(I74<=250000,"350",IF(I74<=300000,"400&...
0
votes
0
answers
50
views
IF statement returning false and not going to next part of formula
I am trying to write an if statement to read a cell that shows the quarter, Cell B3, and based on that, sum the 3 months of that quarter of a separate tab within the same workbook. It works for the ...
0
votes
1
answer
49
views
Optimizing nested ifelse in shiny
This post is not much of a cry for help as my script works exactly as intended, but I was wondering if there was maybe a better way to write it given that it's quite heavy, I may need to make changes ...
1
vote
1
answer
80
views
How to nest two SQL statements
How do I nest these if statements to return a single dataset where chargeType is determined by the description. This is an ETL script to take from source and map various descriptions to an optionset ...
0
votes
1
answer
261
views
IF Formula to auto populate cost center name basis the cost center number in excel
So I have a bunch of cost centers in column A. Basis the cost center number, I want the column B to be filled with cost center name automatically in excel. For example if the cost center number = 101 ...
0
votes
2
answers
78
views
Is there a three-valued case analysis on patterns (a < b) (a = b) (a > b)?
I want my students to prove some stuff overs Binary Search Trees.
Most of the proofs require to perform a case analysis on some arithmetic inequality over three cases:
a < b (recursive call in the ...
-1
votes
2
answers
104
views
Nested if else statement is not working as desired
In the program, no errors.
PASS, CLEARED user inputs are working as desired.
But when I enter NO as user input in the nested if, control picks "else statement" correctly, but also it is ...
0
votes
1
answer
55
views
SAS IF Condition data retrieval
I have a dataset that has many fields out of the 7 needed fields for this condition is
status_reason_code_1
status_reason_code_1_date
status_reason_code_2
status_reason_code_2_date
...
-2
votes
1
answer
94
views
How do I get my t-sql code to check for a condition then stop? not check the next condition. Return should be only one result
Pseudo:
If condition is true, return results and don't look for next condition.
If condition is false, then check for the next condition.
etc ...I have like 6 of these to check in a hierarchy order.
...
1
vote
3
answers
88
views
is it possible to print only one statement in this nested if code?-Java
Our professor asked us to create a code that prints what grade you should be getting for a particular score, in a nested if code in Java
import java.util.Scanner;
public class nestedif {
...
1
vote
1
answer
155
views
Check if uid numbers in /etc/passwd are in a certain range and not already used, with nested ifs
I am trying to check the uid's that are already used and in within a range from 1000 to 60000, with nested if conditions but only the range condition works.
Also it prints the $hpass content.
Any ...
-3
votes
3
answers
3k
views
How do I print if someone is or not eligible to vote by using nested if statement?
I'm trying to print simple lines of text using nested if statement.
but somehow relational symbols return an always false:
//unfinished
import java.util.Scanner;
public class exe6 {
public static ...
0
votes
1
answer
53
views
Python nested if vs and behviour
I was solving the bottom view of a binary tree question using Python. This code is working.
class Solution:
#Function to return a list of nodes visible from the top view
#from left to ...
-2
votes
5
answers
887
views
Can someone tell me what's wrong with this code? It's beginner level
I am completely new to python, i'm learning it online through a course and got stuck in an exercise. I can't figure out the problem at all, i feel like my solution to the exercise is ok but whenever i ...
-1
votes
1
answer
41
views
How to Move a Row to Two Different Locations on a Different Google Sheets Tab Based off Two Different Criteria
I would like to copy and paste a row from one google sheet tab titled "New Projects" to another google sheet tab titled "Project Tab" if column H says "Approved" and then ...
1
vote
1
answer
486
views
Filter in Google Sheets not working within IF statement mismatched range sizes
I am receiving the following error:
FILTER has mismatched range sizes. Expected row count: 1759. column count: 1. Actual row count: 1, column count: 1.
The function in question is:
=IF(F2="",...
3
votes
4
answers
877
views
If statement without curly braces
been looking at this one problem I came across. The question is what does the following snippet return.
int main()
{
int a = 1, b = 2, c = 3, d = 4;
int x = a;
if (a > b)
if (b < ...
0
votes
1
answer
88
views
SML using destructors gives deleting INT0 LPAREN
The following function is using pattern matching.
fun f (x,0) = x
| f (0,y) = y
| f (x,y) = x+y;
I want to write this using if-else. This function of mine works fine:
fun f1(x, y) =
if y = 0 ...
-4
votes
3
answers
5k
views
Write a program to find the greatest of four numbers [closed]
I am new to Programming and currently learning C, so I don't know much about this concept but I was learning Conditional Instructions and at that time, my instructor [I am learning online from YouTube]...
5
votes
1
answer
7k
views
Using IFS with Arrayformula function in Google Sheets
I was wondering if its possible to use an IFS function inside the arrayfunction?
Im looking to have a drop down list populate an array depending on what is selected in the data validation.
the formula ...
1
vote
2
answers
57
views
Replacing if/if with if/and returns false (Google Sheets / Excel)
I need cells on Sheet_2 to return a specific value from Sheet_1 (column K) on the condition that the values in other particular cells on Sheet_2 match with cell values on Sheet_1. I already have a ...
-1
votes
1
answer
61
views
How we will convert nested if - else code into list comprehension in python
I have tried and google the solution for below mentioned code but unfortunately I didn't get anything regarding this.
Don't change the logic pleaseConvert it into list comprehension. I Have tried list ...
1
vote
2
answers
73
views
Showing Top 5 Clients at a dashboard
I want to build a dashboard where I can select a year and a application and want to have the top 5 clients shown up.
I build a example Sheet ofr showing:
https://docs.google.com/spreadsheets/d/...
1
vote
1
answer
27
views
google sheets if and statements not workings
=IF(and('Form Responses 5'!BA:BA="Service/install",if('Form Responses 5'!Y:Y="V723")),sum('Form Responses 5'!Z:Z),"")
I want it so
if ba:ba="service.install" ...
-2
votes
2
answers
417
views
python program for finding greater number among of 4 numbers, using nested if
WHAT IS WRONG IN THIS CODE?
MY PC SHOWS NO OUTPUT WHEN C and D ARE LARGER NUMBERS?
a=int(input("ent a no."))
b=int(input("ent a no."))
c=int(input("ent a no."))
d=int(...
2
votes
1
answer
424
views
Google Sheets QUERY with WHERE on multiple columns at the same time
Following this post Google Sheets QUERY with WHERE on multiple columns I build up my formula to select specific values from more columns but when I had a condition data start to be confused and not ...
1
vote
2
answers
69
views
Filter Data in Googlesheets
I have to face some problem about my Googlesheets Data. I want to filter my googlesheets data between two dates and also filter more conditions at the same time in same sheets. Below are given some ...
-1
votes
1
answer
1k
views
Google Sheets Query With Multiple IF Statements
I am trying to run a some nested IF statements with a query (with an import range to another sheet). Such that, if cell B2 is 'ABC', it will query the ABC sheet and return the value of a cell on that ...
0
votes
1
answer
4k
views
IF formula with multiple conditions and outcomes
I try to create IF formula to give me 3 different outcomes based on number in two cells (e.g. A1 and B1).
The 3 outcomes are:
"NO CHANGE" if A1 or B1 is equal to zero,
"CHANGE BELOW ...
0
votes
1
answer
274
views
GOOGLE SHEETS - Arrayformula for duration between 2 datetime stamps ignoring weekends and our of hours time
I'm trying to work out the duration of 2 date/time stamps, ignoring out-of-hours and weekends. I have a formula that does individual durations (Column D) but when I try turning it into an array ...
2
votes
1
answer
2k
views
Lookup multiple columns in Google Sheets and return a list from the matches
I think the title accurately describes what I'm trying to achieve.
https://docs.google.com/spreadsheets/d/1sRQzXXZ4a3vjAwvsH4rrWfijxV4jCl_OV3iQO00yvlQ/edit?usp=sharing
Essentially, I have a table of ...
0
votes
1
answer
65
views
Return a specific value 'Open' where days are between Monday - Friday and time is >=8:00 & <19:00 all other days and times should return 'OOH'
Return a specific value 'Open' where days are between Monday - Friday and time is >=8:00 & <19:00 all other days and times should return 'OOH'
Open = >=8:00 & <19:00 & Monday ...
1
vote
2
answers
428
views
Shift Time Between Calculation Google Sheet
I am trying to calculate the salary for employees in Google Sheets.
Night Shift - if shift start time lies between 12 am-6am
Day Shift - if shift start time lies between 6am-11:59pm
I am able to ...
0
votes
2
answers
2k
views
How to set a cell value to zero if checkbox is checked
I have a sheet I and I want to have the values in one row be set to zero once the corresponding checkbox is clicked. Here is what my sheet looks like(https://postimg.cc/CBDdYsjN), I want each cell in ...
1
vote
1
answer
4k
views
IF text is found in a list
I am trying to create an IF statement that includes checking if a cell contains a text string from a list of text strings and I'm struggling with the correct way of doing it.
I have a 'Global Settings'...
0
votes
2
answers
764
views
Nested if and countif in google sheets
I am trying to use the following formula:
=if(A16="1",(COUNTIF('responses'!AF:AG,B16))>0,"Yes",if(A16="2",(COUNTIF('responses 1'!AF:AG,B16)))>0,"Yes",...
3
votes
2
answers
215
views
How to restructure nested if else statement
Say you have the following table for a monster object:
Gender
Age
Type
Result
Male
Young
Fire
1
Male
Old
Ice
2
Male
Old
Wood
6
Female
Young
Fire
4
Female
Old
Ice
5
Female
Old
Wood
8
Other
Young
Fire
7
...
0
votes
3
answers
65
views
R: Is There a Better Way Than ifelse to Eval a Number Over Multiple Ranges?
Consider the following code, used to identify an age range:
ages <- c(5,10,15,20,25,30,35,40,45,50,55,60)
get_age_group <- function(age) {
label <- ifelse(between(age, 0, 12), "Kid&...
0
votes
3
answers
668
views
Wrong number of arguments to IF. Expected between 2 and 3 arguments, but got 19 arguments
=(IF(or(E3="Kalyan",E3="Prescribe",E3="Ucook"),"Ram Varan",IF(E3="Mr.Cook",E3="Lifelong",E3="Kimatsu"),"Jay Kumar",IF(E3=...
1
vote
1
answer
67
views
Google Sheets Array If Condition
I have the below formula which works fine and returns the expected results.
=ARRAYFORMULA(iferror(if(row(I:I)=1,"CE Credit",
if(A:A="","",
VLOOKUP(I:I&&...
1
vote
1
answer
37
views
Best approach for formula of matching values in sheet 2
I need to populate column A in sheet two based on multiple columns in sheet one.
For example, here are two of multiple conditions:
If columns A,B,C,D (of sheet 2) are all 5/6 then populate ...
1
vote
1
answer
78
views
Combining Query and Conditional Statement in Google Spreadsheets
Regardiung the function below, I want this line AND P < '"&B5&"' to be applied everytime but not when B3="446".
I'm not sure how to insert this condition in the query ...
1
vote
1
answer
49
views
Arrayformula in google sheet
I don't know how to fix this function to make it work. Every time it returns #N/A.
In column D I have a surname and in C I have first name
=ArrayFormula(
IFS(
ROW(B:B)=1; "Pattern";
...
1
vote
1
answer
119
views
How to find value using INDEX + MATCH with SETS of multiple criteria on Google Sheets?
The formula works if I compare exact days, but it's possible that the person filled out a form today and will only fill out the other the next day, so it's important to test for a couple of days ahead ...
1
vote
2
answers
62
views
Calculate Average of cells that two requirements
How would I work out the average of a range where it has to meet two requirements.
In the example below, I would like to calculate the average 'Score' of all of the 'Type 1' results that are within ...