I have a formula which is almost working.
=IF(Search(".com",C2)C2,ISNA(Left(C2,Aggregate(15,6,Search{(".","_","-")},C2),1)-1),"#N/A"))
the first part (search) works well, but regardless of what's in the cell (other than a .com) it throws a #Value error
Try this:
=IF(ISNUMBER(SEARCH(".com",C2)),C2,
IFERROR(LEFT(C2,AGGREGATE(15,6,SEARCH({".","_","-"},C2),1)-1),"#N/A"))
Also consider replacing "#N/A" with NA() to generate an actual error rather than a text that only looks like an error.
Related
I have the following situation.
I use the function VLOOKUP in Sheet2, using a table array from Sheet1:
=VLOOKUP(A4,Sheet1!$A$2:$B$81,2,FALSE)
I am comparing URLs written in cells formatted as "text".
I basically try to mass replace some URLs with others.
When the URL is a simple one, such as the one below, the formula works fine.
http://www.website.com/page/ that becomes http://www.website.com/newpage/
The formula works fine and returns http://www.website.com/newpage/ in the range cell
When the URL is a complicated one, such as the one below, the formula returns #VALUE!
http://www.website.com/configurator/?dimensiuni%5B%5D=100&toate-categoriile=1&orice-duritate=1&toti-producatorii=1&orice-buget=1&toate_236=1&toate_234=1&toate_235=1&toate_237=1&orice_buget_233=1&toate_216=1&toate_196=1&toate_191=1&toate_211=1&orice_buget_190=1&toate_246=1&toate_244=1&toate_245=1&toate_247=1&orice_buget_243=1&toate_261=1&toate_259=1&toate_260=1&toate_262=1&orice_buget_258=1&toate_281=1&toate_279=1&toate_280=1&toate_282=1&orice_buget_278=1&toate_294=1&toate_292=1&toate_293=1&toate_295=1&orice_buget_291=1
should return
https://www.website.com/magazin/?orderby=price&product_category=tipuri-saltele&dimensiune_saltea=160x190-ro&stock_status=in-stock%2Con-backorder&min_price=30&max_price=9000&lang
but it doesn't. It returns #VALUE!
Any idea what I could do to make this work?
I suspect it's probably because the long and complex URL that it doesn't know how to compute it...
Thanks!
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.
I am building IF(AND formula in Excel with 3 conditions. The formula is looking as follows: IF(AND(I2="#N/A N/A",J2<>"#N/A Field Not Applicable",K2<>"#N/A N/A"),"A",IF(AND(J2="#N/A Field Not Applicable",K2="#N/A N/A"),"B","Ok")).
Problem: for some reason, I don't get anything returned for first condition: IF(AND(I2="#N/A N/A",J2<>"#N/A Field Not Applicable",K2<>"#N/A N/A"),"A". The remaining part of the formula works fine and delivers correct output.
I'd appreciate any advice on how to make this formula work correctly, so it returns "A" in some cases.
The If formula does not work to see if there was a mistake in a cell. The Excel tries to get a value from your cell, gets a mistake, and then you receive the error. Are you trying to concatenate differents "#N/A" in the formulas, for example for comparing "I2 = #N/A N/A"? This alone can result in the same problem I mentioned, when you try to concatenate a cell with a mistake.
As someone suggested, use the formula ISNA(I2) instead, which sees if the cell has a #N/A mistake and returns True or False. You can even do this in the concatenate, for example:
=CONCAT(IF(ISNA(A2),"No Match", "Has a Match"), IF(ISNA(B2),"No Match", "Has a Match") )
That way, you can later compare I2, J2 and so on with other texts, not "#N/A", which isn't technically a text, and avoid this problem.
I have the following data and I'm feeding the results of a Match formula into an Index formula to find a matching value.
When a cell has missing data or data that does not lead to a good resulting value, I get a "#N/A" value.
How would I modify the formula =INDEX(A:A,MATCH(C7,B:B,0)) to put a string like "NO_DATA" in a cell where such situations happen? {In other words, I'd like to see "NO_DATA" instead of "#N/A"}.
Just wrap an IFERROR around it
=IFERROR(INDEX(A:A,MATCH(C7,B:B,0)),"NO_DATA")
=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))