Nested Excel IF function - excel

Okay, currently I have an if statement that looks like this:
=IF(AND(OR(K2<>K3,L2<>L3),A2=A3),A2,"")
My issue is that in column K, I want to take off a few characters. I'd like to write this function: Left(K2, LEN(K2)-2)
I'm not sure how to incorporate that into the if statement though. Any ideas?

Related

Apply function on dataset before using dataset in other function in Excel or Spreadsheets

I have the following function:
=MAX(LEN(B5),LEN(C5),LEN(D5),LEN(E5))
To make it a bit more dynamic, I was hoping to have a function that could apply a function on a dataset before passing it to another function.
Something like this:
=MAX(FUNCTION_I_AM_LOOKING_FOR(B5:E5, LEN))
Does this exist? Or how would you solve this?
Here is an example. I want to avoid that if 10 languages are added, I have to modify the function too much.
In ExcelO365:
=MAX(LEN(B2:E2))
In older version of Excel you'd have to enter through CtrlShiftEnter
In Google Sheets:
=ARRAYFORMULA(MAX(LEN(B2:E2)))

If nested function in Excel

I have written the IF nested function as below, but I am getting CC for all the rows. What is wrong here.
=IF(C122="Credit Cards","CC",IF(C122="Investing","INV",IF(C122="Business","BUS",IF(C122="EDB","EDB",IF(C122="Home Loans","HL",IF(C122="Superannuation","SUP",IF(C122="Investing","INV",IF(C122="Brand","BR","PL"))))))))
Instead of using long nested IF() functions that are prone to errors, you can create a small table with the data you are comparing with (G3:H10 in the example below) and use INDEX():
The formula in this example is:
=INDEX($H$3:$H$10,MATCH(C13,$G$3:$G$10,0))

Excel index() Match() and array issues

I like working with variables in Excel, it is useful converting everything between commas into a variable, but I got stuck in here, does anyone have an idea how to use array limitations with INDEX() function such as seen in the example?
This is an array formula in a table form:
{=INDEX([#Column1]=[Column1],MATCH(1,([Column2]="Ready"),0),0)}
it returns the right value for the first instance of [#Column1]=[Column1] but for the rest, the result is wrong.
A sample can be found in >>>here<<<.
I saved this in another language, please let me know if transcription of functions are incorrect when you open. I tested but..you know..
This does not need to be an array, use COUNTIF/S instead:
=COUNTIF([Column1],[#Column1])=COUNTIFS([Column1],[#Column1],[Column2],"Ready")

case statement in a spreadsheet

So,
what i am trying to accomplish here is pretty straight forward, i have a column fare in my spreadsheet and i want to add anew column that would say if the fare is <10 ,10<20,20<30,30+
I came up with this solution but it seems like it is not using a shortcut condition, is there a case statement or any other method i can use to achieve what i want?
=if(J19<10,"<10",IF(AND(J19>10,J19<20),"10<20",IF(AND(J19>20,J19<30),"20<30","30+"
)))
Try something like this:
=ROUNDDOWN(A1,-1)&"<"&ROUNDUP(A1,-1)
Since the conditions in a nested set of if functions are evaluated consecutively, you do not need to repeat previous conditions using and. Also note that your original formula doesn't do the right thing at the borderlines, e.g. if J19=10.
So although Excel does not have a case function, the following is simpler and more accurate than your original:
=if(J19<10,"<10",IF(J19<20,"10<20",IF(J19<30,"20<30","30+")))

Why does this formula not work in OO Calc, and what will work instead?

This seems like it should work in OO Calc according to this:
http://wiki.services.openoffice.org/wiki/Documentation/How_Tos/Using_Arrays
=SUM(IF(ISFORMULA(G12:G35);0;G12:G35))
Yes I am using CTRL-SHIFT-ENTER and the some of the data is formula and some are just numbers
I only want to sum up the items that are a static entry and not a calculated entry.
I suspect that ISFORMULA does not return an array of True/Falses when you give it a Range.
I do not currently have OOCalc installed so I cannot test - Try array entering =ISFORMULA(G12:G35) into a range (for example Z12:Z35) and see if it gives you the correct answers. If it does not work correctly then you might have to write your own version of ISFORMULA to handle arrays.
I do not know OO, but you could try some alternatives like:
=SUM((1-ISFORMULA(G12:G35))*G12:G35)
or
=SUMPRODUCT(1-ISFORMULA(G12:G35);G12:G35)

Resources