Error with Nested Excel IF formula - excel

=IF(ISBLANK(BLANK(CG3),"",(IF((LEFT(CG,2)="/m"),"mcat||"&CG3,"icat||"&CG3)))
I am getting a #NAME? error on the above formula.
CG3 contains either /mcat/... OR /icat/... currently. I need to add the prefix "mcat||" or "icat||" depending on the text currently there. Also, if CG3 is blank I want it to remain blank.

2 Issues:
Missing parenthesis in the ISBLANK function. (On second thoughts, this looks like a copy/paste issue.)
Missing cell number in the LEFT function.
Should be:
=IF(ISBLANK(CG3),"",IF(LEFT(CG3,2)="/m","mcat||"&CG3,"icat||"&CG3))

Related

Excel: Count consecutive cells that are not empty

I would like to identify which rows don't have consecutive data. For this, I'd like to be able to count the cells across rows until and empty cell is encountered.
Please look at the the screenshot of an example and desired output.
I have tried to play around with the MATCH function, but no look yet. I've tried the following but it's not returning what I would've expect.
{=MATCH(FALSE,ISBLANK(C2:F2),0)}
You may try in this way however there might be a more eloquent way to solve this,
So the formula used in cell G2
=IF(MAX(FREQUENCY(IF(C2:F2,COLUMN(C2:F2)),
IF(C2:F2=FALSE,COLUMN(C2:F2))))<3,"Jumps A Year",
MAX(FREQUENCY(IF(C2:F2,COLUMN(C2:F2)),
IF(C2:F2=FALSE,COLUMN(C2:F2)))))
And Fill Down!
Also note, depending on your excel version you may or may need to press CTRL+SHIFT+ENTER, not just ENTER after entering the formula. You will know the array is active when you see curly braces { } appear around your formula.

Combining IFERROR and LEFT Formulas

I have a formula that looks like this
=IFERROR(B83,"OPEN")
So if a certain cell has an error it changes it to OPEN, but if it doesn't then it returns the values within that cell.
I am trying to make the cell also short the text that is being returned to 7 characters.
I made this formula:
IFERROR(B83,"OPEN"),AND(LEFT(B83,7))
However it does not work and instead returns an "NA".
Appreciate any help.
Try
IFERROR(LEFT(B83,7),"OPEN")
You need to put your desired result as the first argument of IFERROR.

Inserting an INDIRECT into another formula to replace fixed values

I'm trying to do the following.
Take a value in a defined cell
Look up that value on another sheet called 'Updates'.
Look across the row for the last non-empty cell
Look up from there and return the header.
I know that if there was a defined range, the following formula works great for the last two steps.
=LOOKUP(2,1/(Updates!B3:E3<>0),Updates!B2:E2)
However I tried to make it more flexible with INDIRECT and came up with the abomination of a formula which I intended to just copy down.
=LOOKUP(2,1/INDIRECT("Updates!B"&B5+2&":S"&B5+2<>0),Updates!$B$2:$S$2)
However this just returns a #REF error. Is this type of thing not possible or is there a simpler way to go about it?
Thanks
I think you're not closing the INDIRECT statement before making the <>0 test - so move that bracket to the left and it should work; ie
= LOOKUP(2,1/INDIRECT("Updates!B"&B5+2&":S"&B5+2) <>0, Updates!$B$2:$S$2)

Excel Formula returning error:

I am trying to add two cells in excel but it gives an #Value! because I believe I am adding the space if error. Is there a way to add without using a 0 for example because I need to copy the formula down and if there is no value, I want it to be a blank not zero. Thanks!
=IFERROR(IF(ISBLANK(B4*J4),"",(B4*J4)),"")+IFERROR(IF(C4="","",VLOOKUP(C4,Sheet2!$R$1:$S$12,2,FALSE))*J4,"")
Try this: =IFERROR(IFERROR(IF(ISBLANK(B4*J4),"",(B4*J4)),"")+IFERROR(IF(C4="","",VLOOKUP(C4,Sheet2!$R$1:$S$12,2,FALSE))*J4,""),"")
Please consider the following solution:
=IF((B4*J4)+ IFERROR(IF(C4="",0,VLOOKUP(C4,Sheet2!$R$1:$S$12,2,FALSE)*J4),0)=0,"",(B4*J4)+ IFERROR(IF(C4="",0,VLOOKUP(C4,Sheet2!$R$1:$S$12,2,FALSE)*J4),0))
I removed the ISBLANK as per my comments above. Only left IFERROR on the VLOOKUP and wrapped everything in an IF to catch in the event that formula returns zero. Regards,

Excel INDIRECT to ignore errors

I am looking for a way to make an INDIRECT formula ignore errors and print a 0 instead. I have it working in a round about way but would like it neater.
I have an INDIRECT formula to load a cell from a seperate worksheet
=INDIRECT("'Invoice (2)'!A1")
The reason I've used an INDIRECT is so that when the sheet named 'Invoice (2)' is not available (i.e. I've temporarily deleted it) it does not change my formula.
However. When there is NO 'Invoice (2)' sheet, I get the error: #REF!
What I would prefer is the result to be '0'.
I have a work around by hiding this field and then referencing it in an AGGREGATE field
=AGGREGATE(9,6,N19) - The 6 ignores any errors and puts a '0' in place and this works perfectly.
So I guess I am just curious if there is a way to combine the two as to make it neater. You would think there would be an 'ignore error' for other commands other than aggregate.
I have tried =AGGREGATE(9,6,INDIRECT("'Invoice (2)'!A1")) and the script finds the data fine but it does not ignore errors like it should.
Wrap your formula with the IFERROR function thus:
=IFERROR(INDIRECT("'Invoice (2)'!A1"),0)

Resources