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
1
vote
2 answers

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 calculate the salary for night shift employee(D7),…
Ophelia
  • 73
  • 9
1
vote
1 answer

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&" "&U:U,importrange("abc123","Course Catalog Database Export!E:N"),3,0))),"!!!")) I…
Mark
  • 327
  • 1
  • 7
  • 14
1
vote
1 answer

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 corresponding row in sheet one with "mid". If columns…
user19803899
1
vote
1 answer

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 fnction. =IFERROR(QUERY(BDD!A1:T2972; "SELECT A,R,B,C,D,E,S,I,T,P,J,K,L WHERE A…
1
vote
1 answer

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"; LEN(B:B)=0; IFERROR(1/0); ISDATE(B:B)=True; LOWER(…
1
vote
1 answer

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 and behind anyway. This is the working formula…
onit
  • 2,275
  • 11
  • 25
1
vote
2 answers

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 August 2022.
1
vote
1 answer

Pick unique values from two non-adjacent columns

Please see the attached sample: https://docs.google.com/spreadsheets/d/1m625-WxG9VBv5AG-VR9-pf4bUCcG8AMCrb_z3jMYCqo/edit#gid=0 Columns A,B,D and E are my source columns. I want to pick unique values from columns B and E for each date into a dynamic…
1
vote
1 answer

IF MATCH SHOW RESULT IF NOT ""

I'm trying to do a Match for values in a column there is a name and then the corresponding ID, in a part I have the list only for ID so I have to match the name, and I'm using this…
user16239103
1
vote
1 answer

Ordering cell values according to cell number

I have some data spread through different cells. Some cells have comma separated values. I have included an example that can be seen in the link. I need to match the data with cell number and show them in the results section as in the example…
J.J
  • 63
  • 5
1
vote
1 answer

If A ="contact" and B = "" return "XXX" but if A = "contact" and B isn't blank return "Video/Audio"

If A4 ="contact" and B4 = "" return "XXX" but if A4 = "contact" and B4 isn't blank return "Video/Audio" in c4 https://docs.google.com/spreadsheets/d/1OH2i45NyRBThFBMQJ_lYbMtpmYAAzOm0FRp5a1DBOm4/edit?usp=sharing
Stuart
  • 315
  • 1
  • 8
1
vote
1 answer

Joining a QUERY function with OR

I currently have a QUERY function which is set up based on a start date cell and an end date cell, formula as below: =QUERY(Haulage!$A$3:$L$29," Select * Where A >= date """&text('2022 Stats'!S1, "yyyy-mm-dd")&""" AND A <= date """&text('2022…
1
vote
1 answer

Applying array formula for rows with existing data

I have trouble creating automation using Google Sheets. I use array formula for converting duration format from one column, to make it understandeable for Google Data Studio, however, my autiomation, when there's no existing project, needs to append…
xBlady
  • 17
  • 4
1
vote
1 answer

Google form timestamp date

I am looking to timestamp my invoices via google forms. I've tried numerous formulas, but they all seem to fall apart during the form submission. =left(B2:B,(LEN(B2:B)-(FIND(" ",B2:B)-1))) but it's causing the form to break.
1
vote
2 answers

Simplify multiple nested if()'s

Can someone help me simplify this complex nested if()'s algorithm? I know it can be simplified, but I'm afraid I'll mess up with the multiple conditions if I trust myself. $groups = array(); foreach ($items as $item) { if ($item['group_code'])…
Faye D.
  • 833
  • 1
  • 3
  • 16