If Index Match returns a blank, choose other cell as the answer - excel-formula

If Index/Match returns a blank, how can I refer it to another cell as the answer?
I need to find a solution to ask the formula to choose 'Default Image' if the'Variant Image' is blank.
I'm using Index Match Formula to obtain a 'Variant Image'.
If there is no variant image I need the formula to choose the 'Default Image'
The attached image shows the formulas used to obtain 'Variant Image' and 'Default Image'.
Example of why my Index Match formula needs an alternative when answer is blank
I tried adding to the formula, but it didnt work =IFNA(),REF), =IFBLANK(),REF).

You just need to duplicate your formula in the if statement. Something like this should work:
=if(INDEX($I$4:$I$18,MATCH(B23&D23&F23&H23,$A$4:$A$18&$D$4:$D$18&$F$4:$F$18&$H$4:$H$18,0))<>"",INDEX($I$4:$I$18,MATCH(B23&D23&F23&H23,$A$4:$A$18&$D$4:$D$18&$F$4:$F$18&$H$4:$H$18,0)),VOOKUP(A23,B4:I18,8,FALSE))

Related

Excel: Find particular (text) value in range

I'm struggling with something I think should be easy, it seems to be a common problem, I've found another solution here on the website but it won't work here in my document.
I want to find the (exact) value into a range, and having a true or false result if this value was found.
I tried with the combination of the find, isnumber and sumproduct formula but the value is never found, if I use a nested if formula it's working.
I have a dutch version of Excel, that's why you see "onwaar / waar" but onwaar is "false" and waar is "true".
Also my formula is written in dutch, but I translated it through the Excel-Translator.de website, I'm not 100% sure if it's done correctly.
In cell F2 I have this formula:
=SUMPRODUCT(SUMIF(E2, $A$2:$A$11))>0
In cell G2 I have this formula:
=IF(E2=$A$2,TRUE,
IF(E2=$A$3,TRUE,
IF(E2=$A$4,TRUE,
IF(E2=$A$5,TRUE,
IF(E2=$A$6,TRUE,
IF(E2=$A$7,TRUE,
IF(E2=$A$8,TRUE,
IF(E2=$A$9,TRUE,
IF(E2=$A$10,TRUE,
IF(E2=$A$11,TRUE,FALSE))))))))))
Thanks for your help.
First use function =COUNTIF($E$2:$E$11,A2) to know if the search value column contains your value.
Then, use function =IF(F2>=1,"True","False") determine true or false.
Combined, yout get =IF((COUNTIF($E$2:$E$11,A2)),"True","False")
screenshot of working example

Return individual cell values from a wildcard search against a range into individual cells using Excel

so I've been trying to work out this problem in Excel (Office 2016, Mac El Capitan, latest updates installed) but have failed so far.
In essence, I would like to search a range of cells (in this case A2:A9) for a partial keyword (A2). Hence all cells that match this criterium should then appear in the result range (E2:E9). I already struggle with this, as I'm only able to return a single result (e.g. one row entry in E2). I have attempted this with INDEX and MATCH but have failed so far.
After this, I would then look-up the corresponding quantity in range B2:B9 using vlookup, this works for now.
The final, desired outcome is attached as an image.
Thanks a lot for your help.
Apply the formula below to E2 and copy down as far as needed.
=IFERROR(INDEX(A:A,AGGREGATE(15,6,ROW(A:A)/ISNUMBER(SEARCH($C$2,A:A)),ROW(A1))),"no more entries")
in F2 use the following formula and copy down as required as well
=SUMIF(A:A,E2,B:B)
A few caveats.
Since the first formula is performing array like calculations inside the aggregate function, full column references should be avoided. Change A:A to $A$2:$A$9or whatever your range is.
Column A is assumed to be full of unique names
The search is not case sensitive. If you need it to be change SEARCH to FIND
If you do not want to see "no more entries" change it to ""
In Cell E2 enter the following formula
=IFERROR(INDEX($A$2:$A$9,SMALL(IF(ISNUMBER(SEARCH($C$2,$A$2:$A$9)),ROW($A$2:$A$9)-1),ROW(1:1))),"")
This is an array formula so commit it by pressing Ctrl+Shift+Enter. Drag/Copy down as required.
Then to get corresponding quantity enter following formula in Cell F2
=INDEX($B$2:$B$9,MATCH(E2,$A$2:$A$9,0))
Drag/Copy down as required. See image for reference.
Note: SEARCH function is case-insensitive. If you are looking for a case sensitive match, use FIND function.

Search for Text within the TEXT in a cell and return that cell if found

I have browsed internet for examples but cant put it all together to work.
I am looking to search for a case insensitive text within a range of cells and if found bring back the full value of the cell that contains that text.
As per my image above i would like to reference column A, look for it in Range C:C, and if match is found return the full value of that Cell in column B.
So here is your formula, simple VLOOKUP with asterisks(*) to make it a wildcard:
=VLOOKUP("*"&A2&"*",$C$2:$C$8,1,FALSE)
Try this formula in B2 and autofill down.
Remember to use CTRL + SHIFT + ENTER when inputing this formula.
=INDEX($C$2:$C$8,MATCH(TRUE,ISNUMBER(SEARCH(A2,$C$2:$C$8)),0))
It took me some time, since this is my first time answering on here. Hope this helps you get further to your solution:
=IF(FIND(A2,C2)=1,CELL("contents",B2))

Display the value from the formula ONLY if another cell has the value that I want

I've devised a formula that I want my cells to have, but I only want the value to show up if ANOTHER cell is populated with the value that I want.
My current formula is below:
=COUNTIFS($R$3:R21, "Brain")
However, this formula doesn't check whether or not the other cell has the value that I want to check for.
I put together a formula that I thought would check for whether or not the cell is populated:
=COUNTIFS($R$3:R21, "Brain", R21, "Brain")
Unfortunately, this formula doesn't work (it returns #VALUE!). I think it fails because R21 is already included in the COUNTIFS.
I also tried this similar formula, which also failed to work:
=COUNTIFS($R$3:R21, "Brain", R21:R21, "Brain")
I looked online and I found this possible solution:
=IF(ISNUMBER(SEARCH("Brain",R21)),"COUNTIFS($R$3:R21, 'Brain')","")
Unfortunately, this formula displays the text of the formula I want, and not the actual value of the formula.
Does anyone know how I could display the value from the formula ONLY if the cell I'm checking has the value that I want? Thanks.
Try
=IF(ISNUMBER(SEARCH("Brain",R21)),COUNTIFS($R$3:R21, 'Brain'),"")

using hyperlink in a vlookup function

very new to this and only just managed the vlookup, anyway,
i have a workbook which contains two Sheets. On Sheet1 I have the following formula (=VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE)) which displays the ID number from Sheet2. This works correctly but how do I get to appear as a hyperlink so once clicked it goes to the specific cell it got from the vloopkup on Sheet2?
I have tried =HYPERLINK(VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE) but I get the error "Cannot get the specified file".
I would be grateful if anyone can point me in the right direction, thank you.
Ok... this looks crazy. This should work for you. I tested it on my machine and it works:
=HYPERLINK(MID(CELL("filename"),SEARCH("[",CELL("filename")), SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))+1) & ADDRESS(MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2"),VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE))
Let's break it up a little just to explain some of the parts:
MID(CELL("filename"),SEARCH("[",CELL("filename")), SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))+1)
Returns a string [currentFileName], which is the required format for a hyperlink within a workbook.
MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2")
Returns the row number of value of CZ54 in the first column of your VLookup range.
ADDRESS(MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2")
Returns the address of the row found, and the column(3, from your vlookup) in sheet2.
So combined:
MID(CELL("filename"),SEARCH("[",CELL("filename")), SEARCH("]",CELL("filename"))-SEARCH("[",CELL("filename"))+1) & ADDRESS(MATCH(CZ54,Sheet2!$A$1:$A$176),3,,,"sheet2")
Returns the actual address for the hyperlink, which is the first parameter of the HYPERLINK formula.
The second parameter is the Vlookup you provided, and voilĂ .
Edit: A warning if anyone tries to use this for a similar issue, if the lookup_array used in Match or Vlookup does not start with Row 1 or column 1 respectively, you will need to offset the values sent to ADDRESS with a +(starting row or column - 1). Example: Match(CZ54,$A$2:$A$176)+1 instead of MATCH(CZ54,Sheet2!$A$1:$A$176).
Here's a more compact version of Daniel's formula.
Using Hyperlink to link to another sheet in the same workbook, you can replace the reference to the workbook name with #.
Eg =HYPERLINK("#Sheet2!$C$10","Click Here")
So, applying this you get
=HYPERLINK("#"&ADDRESS(MATCH(E21,Sheet2!$A$1:$A$176),3,,,"sheet2"),VLOOKUP(E21,Sheet2!$A$1:$Y$176,3,FALSE))
HYPERLINK is looking for text so if you were to do something like
=HYPERLINK(left(VLOOKUP(CZ54,Sheet2!$A$1:$Y$176,3,FALSE),255))
it should return a usable hyperlink

Resources