ARRAYFORMULA - How to reference previous column - google-sheets

Lets say I have a row where's there's a % increase based on the value in the previous Column so
A1 = 1
B1 = A1*1.1
C1 = B1*1.1
....
G1 = F1*1.1
Is there an ARRAYFORMULA that can be entered into B1 that can do this?

#pnuts's answer can be improved upon and made to work by actually deleting part of his formula:
=transpose(ArrayFormula(1.1^row(1:10)*A$1))

Related

Make a cell empty instead of zero if its formula fails in Google Sheets

Lets say I have 3 cells with the following contents:
A1 = "" (Empty)
B1 = "" (Empty)
C1 = PRODUCT(A1, B1)
I assumed C1 would be empty given that A1 and B1 are empty. However, C1 displays 0 instead. What I want to do is make C1 empty if any/both of A1 and B1 is/are empty. Is there a way to do this? I read somewhere that spreadsheets treat empty cells as 0.
you can do it like:
=IF(LEN(A1&B1), PRODUCT(A1, B1), )
Just use If():
=IF(OR(A1="",B1=""),"",PRODUCT(A1,B1))
(Or use AND() if both need to be blank to return "".)

How to SET CELL VALUE without written any formula in it

I have values in
A2 = "2"
B2 = "1"
C2 = "3"
and formula in D2
Is it possible to set a value of Cell A3 equals to C2 without putting any formula in A3 and depending upon results of D2 and not using app script?
Like if:
D2 = if(A2>B2,than value A3= C2 eles keep blank
no, it's not possible without formula & without script. the formula would be:
=IF(A2 > B2, C2, )
however, you can add a column to the left of A column and then put this formula in A3 cell:
={"", IF(B2 > C2, D2, )}
For (almost?) all practical purposes "can't be done" but as a curiosity, and perhaps with some liberal interpretation of the requirements (and because tagged google-query-language), it might be considered technically feasible (if largely useless). Assuming the 'trigger' is for the formula in D2 to return 9, in A2 with A3 blank:
=query(C2:D2,"select C where D=9 label C '2'")

Google sheets - VLOOKUP inside ARRAYFORMULA

I am trying to do Vlookup inside an Array formula in Google Sheets.
I have two sheets, S1 and S2.
Each has 3 identical columns, Col A (Date), Col B(Name) and Col C(Payment-Type)
I would like to read the payment type from sheet 2 into sheet 1 based upon date and name combination match. Meaning if the date and name matches in sheet 2, return the Payment Type.
Here is my Vlookup formula,
=VLOOKUP(A2,FILTER('S2'!A2:C7,'S2'!A2:A7 = A2,'S2'!B2:B7 = B2),3,FALSE)
Above formula explained:
S1 is sheet 1 and S2 is sheet 2
A2 <- Date from sheet 1
'S2'!A2:C7 <- Entire sheet 2 range
'S2'!A2:A7 = A2 <- Comparing sheet 2 dates with Date in A2 of sheet
1
'S2'!B2:B7 = B2 <- Comparing sheet 2 names with Name in B2 of sheet
1
3 <- Returning the third column value which is Payment Type if the
date and name match.
This works well. Here is a link to the spreadsheet with an example:
https://docs.google.com/spreadsheets/d/1tIlq_kBWlM1Stj_Iqoua2LswW2IUl7TBbhnFFhPX4uo/edit?usp=sharing
I would like to replace the Vlookup formulas on all rows with just one Array formula in the second row.
This is what I have now which is not working.
=ARRAYFORMULA(VLOOKUP($A$2:$A$7,FILTER('S2'!A$2:C$7,'S2'!$A$2:A7 = $A$2:$A$7,'S2'!$B$2:B7 = $B$2:B7),3,FALSE))
Please, can someone tell me what is wrong here? I am pretty poor with these formulas. Kindly refer the sheet I attached above. That will explain everything to you.
Remove all contents of column C and then enter in C1
={"Payment Type"; ARRAYFORMULA(IF(LEN(A2:A), VLOOKUP($A2:A&B2:B,{'S2'!$A$2:A7&'S2'!$B$2:B7, 'S2'!$C$2:C7},2,FALSE),))}
See if that works?

Counting unique values when other criteria must also be met

I'm having difficultly with Google Sheets counting unique rows, where other criteria in the formula must also be met.
I've created a simple Google Sheet to highlight the problem I need solving.
https://docs.google.com/spreadsheets/d/1P0sHIUN12Wpbr6vKJAwsPluj-T2H-NrPpQ1_WWV7lvI/edit?usp=sharing
I need the formula in cell C5 to only count unique values in row G, where the criteria is met in rows F & H (the SP is “DG” and the likelihood is “Booked”). I cannot work out how to make this only count unique values. The formula I currently have only counts any cells that are not blank in row G, it does not look for unique values but needs to.
The working formula should give the following answers:
C3 = <> C5 should equal 3
C3 = 1 C5 should equal 1
C3 = 2 C5 should equal 2
C3 = 3 C5 should equal 1
Please can someone help?
EDIT
The formulas I've already tried won't make sense with the example in the link but to show what I have attempted
=COUNTIF(UNIQUE(QUERY(AA:AM,"Select AC where AA = 'DG' and AL = 'Booked' and AM = '" & I2 & "'")),"<>")
It returned a 1 regardless of how many it should have returned.
=COUNTUNIQUE(QUERY(F2:I21,"Select G where F='DG' and H='Booked' "&IF(ISBLANK(C3),,"and I="&C3&"")))
QUERY to get G column subject to conditions
COUNTUNIQUE to count unique G Rows

Add #N/A and a number from other cell

I need to add three cells in excel 2010, for example:
val1 = 1
val2 = 3
val3 = #N/A
sum = 4
As you can see, I need the result to be a number, not #N/A.
I would like #N/A to count as 0.
Thank you!
Try this:
=SUM(IF(ISERROR(A1:A3),0,A1:A3))
Entered as Array Formula by pressing Ctrl+Shft+Enter in Cell A4 assuming your data is in Column A.
Change the address otherwise.
I have solved it myself, but L42 pointed me into the right direction.
In my table, data is located in J2, K2 and L2 and the sum is in M2 where I entered the final formula: =IFERROR(J2;0)+IFERROR(K2;0)+IFERROR(L2;0)
which basically means that I have manually added the 3 cells but checked for errors first, for each cell, with the function iferror and returned 0 if error exists.
Thank you!

Resources