If statement with multiplication - if-statement

I am using this formula.
=IF(OR($U2>EOMONTH(AF$1,0),$V2<AF$1),“”,$AE2*(MIN(EOMONTH(AF$1,0),$V2)-MAX(AF$1,$U2)+1)/IF(MOD(YEAR($AF$1),4)=0,366,365))
I need to make this formula multiply by whatever is in cell C3 if the value returned is greater than 0. I tried the product function but I am having trouble with placing it into the formula. I keep getting the error
#Value

You could try placing your whole formula in a MAX function:
=MAX(your_formula,0)*C3
If you are looking for a different solution, it would be very helpful to have some more information or a data example.

Related

Google sheets - How to compare a formula within a cell with a string to spot changes in the formula?

I help a small business with an application which is entirely run from google sheets and google forms. The issue is that from time to time the business owner will go into the sheet and delete rows of old data. I've noticed that as a result, some of the formulas will change the row which they are looking at. This is despite me using explicit cell references such as $A$1 for example.
So what I would like to do, is use somehow compare the cell which contains the formula, with a string of what the formula should be, then return a value if the formula matches. I had thought an =If function would solve this but so far I am not having any luck.
This is what I have used so far:
Lets say cell A1 contains the formula I want to check and the formula is (this works fine): =FILTER(Dashboard!A2:A, Dashboard!C2:C1 = TODAY())*
I am using =IF(A1="=FILTER(Dashboard!A2:A, Dashboard!C2:C*1 = TODAY())",True,False)
I am expecting the function to compare the value of A1 with my string and return the value True. If the formula does not match the string it should return the value False.
I currently am returning the value of False despite the formula and string being an exact match. I assume this is because my =If statement is looking at the value returned by the =Filter function rather than the formula itself.
Any help would be appreciated.
thanks
You could just use INDIRECT() in the place of explicit cell ($A$1) reference you mentioned and that should solve the problem of formulas going haywire due to rows deletion in Form Responses tab. Please do test it out.
INDIRECT("Sheet!"&A1)
INDIRECT("A1")

Nested IF function inside a vlookup for google sheets

I'm trying to nest an IF function inside a vlookup to filter data based on a cell in another sheet.
The ideal functionality would be for the cell to return data if it meets a specific criteria otherwise leave it blank.
This is what I have so far:
=IFERROR(vlookup(E2,IF('internal_all[Paste Here]'!H3="Indexable",'internal_all[Paste Here]'!A:AB,""),28,0))
Currently, it doesn't work but instead I get an error "VLOOKUP equates to an out of bounds range".
Any help would be much appreciated.
Here's a copy of my gsheet: https://docs.google.com/spreadsheets/d/13mcOOHIP6-YQKOhE_LHnmu3-7bSNKzvCSTVZ5BnTxPA/edit#gid=0
Here's an example of the error I'm running into:
If I understand your question correctly...Then all you would need to change is where you put the if. Including it in the Vlookup will mess with the size of range ie. A:AB has a size of 28 but "" has a size of 0. I would also change your formula to an array so you don't have 6000+ formulas calculating. Finally, I would add an array_constrain to stop the array at the end of your dataset. Here is a working example:
=Array_Constrain(ArrayFormula(IF('internal_all [Paste Here]'!B2:B="Indexable",vlookup(E2:E,'internal_all [Paste Here]'!A2:AB,28,0),"")),CountIf(A2:A,"<>"),1)
I also included that formula in H2 of your "internal links point to canonicalised URLs" tab. Good luck!
Edit:
After looking at the setup again, this updated formula should work.
=Array_Constrain(ArrayFormula(if(VLOOKUP(E2:E,'internal_all [Paste Here]'!A:B,2)="Indexable",vlookup(E2:E,'internal_all [Paste Here]'!A2:AB,28,0),)),CountIf(A2:A,"<>"),1)
Also, here is an updated Indexability formula for column G
=Array_Constrain(ArrayFormula(IFERROR(vlookup(G2:G,'internal_all [Paste Here]'!A:B,2,0))),CountIf(A2:A,"<>"),1)

Stuck on Concatenation array formula with multiple criteria

I have a formula which worked quite well to obtain information in order to link a reference contained in column B with information in T column of Sheet 2.
I have a formula which checks if 'Sheet2'!B:B=B2. However, now I want the formula to only return information where the corresponding line also has "yes" in Column A.
For example, if B2=1001, I only want to return CAT in the example below:
Is it possible to have two criteria like this?
I have tried various AND formulas alongside the main formula I have but this brings back errors:
=IF(ISBLANK(A4),"",ARRAYFORMULA(TEXTJOIN(" ⦿",TRUE,IF('Sheet2'!B:B=B2,'Sheet2'!T:T,""))))
I need to put somewhere in this formula to check if A2="Yes"
=IF(ISBLANK(A4),, ARRAYFORMULA(TEXTJOIN(" ⦿", 1 ,
IF((Sheet2!A:A="yes")*(Sheet2!B:B=B2), Sheet2!T:T, ))))

If statement with multiple conditions in Excel and then calculate a formula

I have an IF statement that says if AG, AL, AJ all have Yes in the cell then I want it to go to a lookup table to retrieve a result. I then want it to take that result and perform a calculation but I don't know how to write it.
If one of the three cells has a no in it, then I just want it to return the value in cell AK
Here is an example:
IF(AG="Yes", AI="Yes", AJ="Yes"), VLOOKUP(Payout Table!A:B,201, 2,True), (O7*H17*AK) False=AK
This is my first time trying to do this so if you can recommend a link I can go to too better understand the correct formula that would be great.
What you want here is the AND function. AND returns TRUE if all of its own arguments are TRUE. ie:
=IF(AND(AG1="Yes", AI1="Yes", AJ1="Yes"), VLOOKUP(Payout Table!A:B,201, 2,True)*(O7*H17*AK), AK1)
Note also that I have fixed your formula for making the VLOOKUP amount multiply against your other cells, and also that I have added row references to what you had there ("AG" is not a valid cell reference; replace "AG1" with the appropriate row number you want to check against).
You need to use AND as well as change the order of your VLOOKUP like below:
=IF(AND(AG="Yes",AI="Yes",AJ="Yes"),VLOOKUP(201,Payout Table!A:B, 2,True)*(O7*H17*AK), AK1)

Excel Formula Calculations

I'm trying to add a spreadsheet editing function in my iOS app. I am using a gridview to display (not relevant to the question) and I am using LibXL to load the data into the view. That part all works very well but I have no way to calculate the formulas after a cell has been modified.
It appears that when I write a formula with LibXL it is not calculating the new value, just setting the formula value (a string). So when I try to read the number value from that cell it is still set to the last computed number (from excel).
Likewise, if I create cells with numbers and a formula cell to SUM them, it is never actually computed which reads a 0 number value until it's opened in Excel.
I was hoping LibXL was the silver bullet to my problem, but now I'm stuck with just the formula string value (i.e. "SUM(A1:b2)" ) and the last computed value.
I would love it if LibXL simply DID compute values and I just have it all wrong, but I can't see any documentation that says otherwise. If that's not the case are there any Obj-C, C, or C++ libraries that I can use to match the Excel Formula syntax and compute these values?
Just adding my previous comment as an answer:
Dave Delong's DDMathParser has the option to add custom functions, check it out here: http://github.com/davedelong/DDMathParser