Multiple IF statements between number ranges

It’s a little tricky because of the nested IFs but here is my answer (confirmed in Google Spreadsheets): =IF(AND(A2>=0, A2<500), “Less than 500”, IF(AND(A2>=500, A2<1000), “Between 500 and 1000”, IF(AND(A2>=1000, A2<1500), “Between 1000 and 1500”, IF(AND(A2>=1500, A2<2000), “Between 1500 and 2000”, “Undefined”))))

How do you create a “reverse pivot” in Google Sheets?

I wrote a simple general custom function, which is 100% reusable you can unpivot / reverse pivot a table of any size. In your case you could use it like this: =unpivot(A1:D4,1,1,”customer”,”sales”) So you can use it just like any built-in array function in spreadsheet. Please see here 2 examples: https://docs.google.com/spreadsheets/d/12TBoX2UI_Yu2MA2ZN3p9f-cZsySE4et1slwpgjZbSzw/edit#gid=422214765 The following is the … Read more

GoogleFinance often returns #N/A and internal error messages while getting stock quotes

you can either use alternative to GOOGLEFINANCE (depends on what exactly are you up to) or if you want to stick with it you can wrap it into IFERROR: =IFERROR(GOOGLEFINANCE(your_formula_here), GOOGLEFINANCE(same_formula_here)) or even: =IFERROR(IFERROR( GOOGLEFINANCE(your_formula_here), GOOGLEFINANCE(same_formula_here)), GOOGLEFINANCE(same_formula_here))

Is there a way to evaluate a formula that is stored in a cell?

No, there’s no equivalent to Excel’s EVALUATE() in Google Sheets. There’s long history behind this one, see this old post for instance. If you’re just interested in simple math (as shown in your question), that can be done easily with a custom function. function doMath( formula ) { // Strip leading “=” if there if … Read more

How do I combine COUNTIF with OR

One option: =COUNTIF(B:B; “Mammal”) + COUNTIF(B:B; “Bird”) According to the documentation: Notes COUNTIF can only perform conditional counts with a single criterion. To use multiple criteria, use COUNTIFS or the database functions DCOUNT or DCOUNTA. COUNTIFS: This function is only available in the new Google Sheets. Example: =DCOUNTA(B:B; 2; {“Type”; “Mammal”; “Bird”})

Split string and get last element

Edit: this one is simplier: =REGEXEXTRACT(A1,”[^/]+$”) You could use this formula: =REGEXEXTRACT(A1,”(?:.*/)(.*)$”) And also possible to use it as ArrayFormula: =ARRAYFORMULA(REGEXEXTRACT(A1:A3,”(?:.*/)(.*)$”)) Here’s some more info: the RegExExtract function Some good examples of syntax my personal list of Regex Tricks This formula will do the same: =INDEX(SPLIT(A1,”/”),LEN(A1)-len(SUBSTITUTE(A1,”/”,””))) But it takes A1 three times, which is not … Read more