Formula help required to display the desired result with multiple criteria in cells.
In the below table D2 cell the formula is added to to show the result eg: F2 cell. The criteria of finding the specific text in A2 cell is the blocker in the function to give the desired result
=IF(AND(ISNUMBER(SEARCH("FF",A2)),B2=1,C2="MC"),"Fotp"),IF(AND(ISNUMBER(SEARCH("2D",A2)),B2=1,C2="MC"),"2D"),IF(AND(ISNUMBER(SEARCH("MF",A2)),B2=5,C2="MC"),"Modfix"),IF(AND(ISNUMBER(SEARCH("SE",A2)),B2=0.7,C2="SE"),"SoEv"),IF(AND(ISNUMBER(SEARCH("M Cat",A2)),B2=19,C2="MC"),"Mcat"),IF(AND(ISNUMBER(SEARCH("M cod",A2)),B2=1.25,C2="MC"),"Ing")
Try
=IF(AND(ISNUMBER(SEARCH("FF",A2)),B2=1,C2="MC"),"Fotp",(IF(AND(ISNUMBER(SEARCH("2D",A2)),B2=1,C2="MC"),"2D",(IF(AND(ISNUMBER(SEARCH("MF",A2)),B2=5,C2="MC"),"Modfix",(IF(AND(ISNUMBER(SEARCH("SE",A2)),B2=0.7,C2="SE"),"SoEv",(IF(AND(ISNUMBER(SEARCH("M Cat",A2)),B2=19,C2="MC"),"Mcat",(IF(AND(ISNUMBER(SEARCH("M cod",A2)),B2=1.25,C2="MC"),"Ing")))))))))))
Your original formula is not nesting the IFs properly.
By the way I think if you can make a look up table with all the criteria and expected result, then there is a quicker way of returning the result without the need to use nested IFs (just imagine if you have 100+ combination of criteria).
Related
Good day.
In it's basic form, I need to count how many cells are empty.
Using the following below, I can count how many cells are empty.
=COUNTIF(Sheet1!C:C,"<>")
However, if the cells in column C contain formulas, it won't work.
After some googling, I found out that using SUMPRODUCT will get what I need
=SUMPRODUCT(--(LEN(Sheet1!C:C)>0))
Now, here's my problem.
I need to use that as a criteria inside a COUNTIFS function, but I don't know how to do that because it's referencing some ranges.
So just to make it simple, using COUNTIF or COUNTIFS function specifically, how can I pass a criteria that checks if cell (with formula) is empty.
This formula returns 0 but most likely I'm just not passing it properly as a criteria.
=COUNTIF(Sheet1!C:C,SUMPRODUCT(--(LEN(Sheet1!C:C)>0)))
Happy for other ways to count cells (with formulas) which are empty, but I need to use it as a criteria for a COUNTIF/COUNTIFS function.
Thank you very much.
If I understand what you're looking for, you were pretty close already.
Following the formula's you already found you can use them like:
=COUNTIF(Sheet1!C:C,"<>")-SUMPRODUCT(--(LEN(Sheet1!C:C)>0))
It will result in the count of cells that have a value/formula minus the count of cells that show a value (blank formula result is excluded).
The result is the count of cells that contain a formula with blank result.
I need to categorize data: I have a column with the description of the element I'm interested in. I want to check that description for a keyword, then check if that keyword is contained in for example column A of a separate table. If a match is found, I need returned the value in the next column (in this example column B) of the same separate table.
The attached screenshot shows how the data is organized. The column called Column1 is the output I need.
I have actually found a solution, but it involves lots of nesting, I need to force the categories and keywords in the formula and I can't add all the conditions I need; this is the current formula:
=IFERROR(IF(SEARCH("keyword";cellWithDescription);"category";);"OTHER")
And for more categories I repeat the formula instead of "OTHER":
=IFERROR(IF(SEARCH("keyword";cellWithDescription);"category";);IFERROR(IF(SEARCH("keyword2";cellWithDescription2);"category2";);"OTHER"))
which is not ideal, especially with many categories. How can I accomplish the same task with a simpler and more efficient formula, possibly comparing the keyword to values in a table (and not inside the formula itself, as I did now)?
Thanks in advance for your help!
This works for me
=INDEX(category,MATCH(1,--ISNUMBER(SEARCH(keyword,cellWithDescription)),0),1)
enter as array formula, thus ctrl+shift+enter after copying the formula (curly brackets will appear around the formula)
I am straggling with some formula that I have a spreadsheet that contains two range of cells. What I want to do is,
I would like to create a search Box that will search a value from Range A and if found return range B value and also will count of range B value is repeated.
Below image is for what I mean
I used INDEX, MATCH and also IF Functions :( but not really get what I wanted.
I am poor in formula, so it would be great if someone can figure out what kind of functions I should use for this.
For information, it can be achieved through formula as below.
E3 houses the value being searched for e.g. "A"
In cell F3 insert following array formula which needs to be committed by hitting CTRL+SHIFT+ENTER simultaneously.
=IFERROR(INDEX($B$1:$B$1000,SMALL(IF(IFERROR(MATCH($E$3&$B$1:$B$1000,$A$1:$A$1000&$B$1:$B$1000,0),0)=ROW($B$1:$B$1000),ROW($B$1:$B$1000)),ROWS($A$1:A1))),"")
Copy down as much as you need.
You need to adjust 1000 to suit your data. It should match last row.
In cell G3 you can use following formula.
=IF(F3="","",COUNTIFS(A:A,$E$3,B:B,F3))
Copy down as much as you need.
I have data that extends from column A1 to F1. All the cells contain VLOOKUP formulas looking up data from an external Excel file.
I want to be able to insert a formula in column G1 to count the number of times a certain filename is used in columns A1 to F1.
I know that if the data in cells A1 to F1 were NOT formulas I could use something like the below in G1 if I was searching for the string "filename.xlsx" using wildcards:
=COUNTIF(A1:F1, "*filename.xlsx*")
However, as A1 to F1 contain formulas, I assume I would need to use FORMULATEXT, in order to look within the VLOOKUPs. I have tried the below, but it doesn't work:
=COUNTIF(FORMULATEXT(A1:F1),"*filename.xlsx*")
Does anyone know if there is a way to do this? it would also be good if the criteria within the COUNTIF was a cell reference. However, that isn't essential.
Thanks
Try using this array formula
=COUNT(SEARCH("filename.xlsx",FORMULATEXT(A1:F1)))
confirm with CTRL+SHIFT+ENTER
or a non array version.....
=SUMPRODUCT(ISNUMBER(SEARCH("filename.xlsx",FORMULATEXT(A1:F1)))+0)
I just learned about using wildcards in Excel functions like COUNTIF(), and I wondered whether there is any circumstance under which the following two formulas would give different results:
=COUNTIF(B1:B10,"*")
{=SUM(ISTEXT(B1:B10)*1)}
The objective is to count the number of text (non-numeric) values in the range.
In the following example, B3 is the formulta =MID("abc",3,1) and B9 is the formula =SUM(1,2), so I know it works for formulas that return text or numeric values. But is there any odd type of cell content that would cause COUNTIF() and the SUM array formula to give different counts?