getting value instead of text in within the formula - Microsoft excel - excel-formula

I need a solution for my problem. My problem is, while using "IF" we can set the output as a text, instead can we get the output as one of the cell values?
As I have about 121000 rows, it will be a hell to do it manually.
hope you guys understood the question. sample is enclosed in the image.Image
I have condition with it. If both the cells contain same value or different value, that value in the D Col has to be taken.

Adding "" to the cell value C2 or D2 like "C2" will return the cell address as a text. So your formula should be,
=IF(C2=D2,C2,D2)

Related

Excel IF statements, with 3 conditions if a=true and b=true and c=true then d1 = ""

I want to make an excel formula so that, I can test out 3 columns and if they are true then to set a new value to the 4rth column.
I have this formula:
=IF(AND(A1="ALFA ROMEO"; B1="159"; C1="55");D1="2016";D1="")
and I want to check if A1 and B1 and C1 are true then to set D1 equal to a certain value.
*I've tried many complex ways to achieve it but this formula is the only one that doesnt pop up an error, but still gives back the Value FALSE(Not in D1, but in the cell I tried it). I've also tried seperating with commas etc...
Any possible help or way I could achieve the check?
It should come from the quote ("") around the number
I've try this
=SI(ET(A1="ALFA ROMEO";B1=159;C1=55);2016;"")
and it worked for me (sorry it's in french).
Maybe try to change cell format from the column B and C.
And also put the formula in cell D1 or in the cell you want the value.
You're almost there, but you need to put this formula here in cell D1 in order to fill the value of D1:
=IF(AND(A1="ALFA ROMEO", B1=159, C1=55),2016,"")
Keep out: in my locale I'm working with commas, while you might be working with semicolons, so your actual formula might be (in cell D1):
=IF(AND(A1="ALFA ROMEO"; B1=159; C1=55);2016;"")
Also, no need to put numerical values (159, 55) as strings, as you can see.
Edit: about turning B1 into a string:
I've just created this formula:
=IF(TEXT(B1,"0")="159","TRUE","FALSE")
This allows you to convert B1 into text.
So, your formula might turn into something like:
=IF(AND(A1="ALFA ROMEO", TEXT(B1, "0")="159", TEXT(C1,"0")="55"),2016,"")
(Again, mind the locale settings (commas and semicolons))

Use a combined formula to return the value of a cell

I am trying to obtain the value of a cell that is in a different sheet, from a formula that returns the value of the row where it finds a match.
Basically, what I'm trying to imitate is:
=Sheet!Column Row
But as follows
=Sheet!Column Formula (Which returns the row that meets the conditions of the formula)
The problem is that I tried concatenating the name of the sheet, the column and the result of the formula (row), which works, since I get, for example:
=Risks!K3
But that's all, I get a kind of string and in reality I would need that result to also be calculated by excel and return, precisely, the value of cell K3.
Is there any way to solve it?
Use INDEX:
=INDEX(Risks!K:K,formulathatreturns3)

Excel formula unique list formula not working, if counta = 1

I have the following formula to make a unique list from column plant in table 15:
{=IFERROR(INDEX(Tabel15[Plant];MATCH(0;COUNTIF(Analyses!$Q$2:$Q2;Tabel15[Plant]);0));"")}
This formula is working, but when there is just 1 value in column plant the formula gives a value of 0. This is wrong because it should return the value.
Does anyone know how I can adapt this formula to make it work?
I wanted to change it to this:
{=IF(COUNTA(Tabel15[plant])>0;INDEX(Tabel15[Plant];MATCH(0;COUNTIF(Analyses!$Q$2:$Q2;Tabel15[Plant]);0));Kopie - datablad$G$2)}
But it doesn't work either.
Good mock example. Try and see if this works:
The formula counts the unique cells against another list. The unique list expects to take the first row, no matter what. It also expects you to have more than one value in your duplicate list. If it doesn't you can't compare since it expect duplicates and it throws an error, #N/A. This is mask as blank cell since it's wrapped in IFERROR:
"Unique formula" = IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF($Q$1:Q2,Tabel15[Plant]), 0)),"")
To solve this we check how many values it exist in our duplicate list:
=IF(COUNTA(Tabel15[Plant])>1,... "Unique formula" ... ,Tabel15[Plant]) //***//
This will give us this result.
Then you probably don't want duplicates...
So we need to check if previous rows contain any of the values the formula would return.
The VLOOKUP formula do that for us, and as lookup value we use the formula above //***// and lookup range will be our current column: $Q$1:Q2. NOTICE this is a dynamic range so Q2 is relative reference (no $).
=IF(ISERROR(VLOOKUP(IF(COUNTA(Tabel15[Plant])>1,IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF($Q$1:Q2,Tabel15[Plant]), 0)),""),Tabel15[Plant]),$Q$1:Q2,1,FALSE))
So the Final result we need to apply is this in Cell Q3:
=IF(ISERROR(VLOOKUP(IF(COUNTA(Tabel15[Plant])>1,IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$1:Q2,Tabel15[Plant]), 0)),""),Tabel15[Plant]),Analyses!$Q$1:Q2,1,FALSE)),IF(COUNTA(Tabel15[Plant])>1,IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$1:Q2,Tabel15[Plant]), 0)),""),Tabel15[Plant]),"")
The macro error can be ignored by:
If Not IsError(Sheets("Hulpblad").Range("B6").Value) Then
t = Sheets("Hulpblad").Range("B6").Value
'Code...
End If
there is no problem in your formula, it is just telling that there are blanks in the range, 0 means blank. the formula is treating the blank as a value and also considering it in the unique value calculations.
If you want to remove 0 you can just insert an if over your formula to remove it. like
=if(formula = 0, "", formula)
or in orignal form
=IF( (IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$2:$Q2,Tabel15[Plant]),0)),""))=0,"",IFERROR(INDEX(Tabel15[Plant],MATCH(0,COUNTIF(Analyses!$Q$2:$Q2,Tabel15[Plant]),0)),""))
or go in the cell formatting and change the format to display 0 as a dash.
sometimes blank is also used as error checking, you can apply such formulae as well to check how many are blank, maybe that would someday be used to check any data entry problems.

Excel Formula with if, then

I need to write a formula in Excel that performs the following:
If cell A1 contains the text ".png",".jpeg" then cell B1 = Image
If cell A2 contains the text ".mov",".mp4" then cell B2 = Video
And so on...
Also, is it possible to apply this validation with additional validation already applied? Like a list.
Solution
I broke the solution to parts so you won't be shocked by a long line of formula.
What I need to get it to work
Extract the suffix of a string, I've done that using the length of the string in column B and then putting it in column C.
B2=LEN(A2)
C2=IFERROR(RIGHT(A2,LEN(A2)-SEARCH(".",A2)),$J$4)
The IFERROR is in case the file doesn't contain a dot and then column C will show the message in cell $J$4.
Get the type by a so called "database" table which I've built to map which suffix belongs to which type of file
D2=IFERROR(INDEX($F$2:$G$8,MATCH(C2,$F$2:$F$8,0),2),$J$6)
I've used the INDEX and MATCH functions to fetch the data from the database.
The IFERROR in this case means - I didn't find the desired prefix in the Database table (in $F$2:$G$8)
After filling these formulas, drag down the data to the rest of the cells and you'll get the desired results.
Here's an image of my Excel file and below it you'll see the cells mapping to prevent you from guessing where is what.
Cells Mapping
Database = $F$2:$G$8
No Dot string = $J$4
Not a valid suffix string = $J$6
=IF(
OR(ISNUMBER(SEARCH(A1,".png")),ISNUMBER(SEARCH(A1,".jpeg")))
,"Image"
,IF(
OR(ISNUMBER(SEARCH(A2,".mov")),ISNUMBER(SEARCH(A2,".mp4")))
,"Video"
,"")
)
Please check for the closing brackets yourself as I just typed this off my head.
That formular should be used for cell B1

using =if and Cell in the same formula?

I hope someone can help me.
I am trying to use specific critirea to bring back cell information.
I have some raw data on Sheet 1, and on sheet 2 I have a list of references, I want to know if those references are in my raw data on sheet 1 and if so, tell me what cell it is in.
the formula I have tried is:
=IF(Sheet1!A:A=Sheet2!A1,Cell("row"),0)
This just brings back '0' all the time, even though I know the data is in sheet 1.
Can anyone help me please?
Unfortunately you cannot compare a range to a single cell Sheet1!A:A = Sheet2!A1 in Excel without array formulas.
Instead, use the MATCH function, which returns the position of a matching cell. In your case:
`=MATCH(Sheet2!A1,Sheet1!A:A,0)`
If your search range extends in a single column (e.g.:[A1:A100]), then you could try the following, which will inform you: a) if your lookup value was not found, and b) if the value is found, it returns you in which row it was found for the first time only. That is, if the lookup value exists in more than one cells inside your search range, this function will return only the row of the first cell containing the value.
In this example, B1 is the lookup value, and A1:A10 the search range:
=IF(ISNA(MATCH(B1;A1:A10;0));"does not exist";CONCATENATE("found on row:";MATCH(B1;A1:A10;0)))

Resources