EXCEL formula with multiple conditions - excel

I am in turmoil of IF, OR and AND in Excel formula.
Basically, I have two different cells. I want to first check that each cell is have Text or Number and if its having either of it, then I want to compare both cells and display the result in Third cell.
So it would be like
IF
Cell A2 --> Check if it contains Text or Number
AND
Cell B2 --> Check if it contains Text or Number
THEN
Cell C2 --> Compare A2 and B2
Example 1: Positive
A B C
1 abc123 abc123 PASS
Example 2: Negative
A B C
1 abc123 abc113 FAIL
Example 3: Negative
A B C
1 113 113 FAIL
I hope above example will help.
So far, I've tried:
=IF((IF(OR(ISNUMBER(A2),ISTEXT(A2)),A2,""))=(IF(OR(ISNUMBER(B2),ISTEXT(B2)),B2,"")),"PASS","FAIL")
In above example, if I leave any cell empty, still it is showing Pass.
Thanks in advance...

=IF(AND(OR(ISNUMBER(A2), ISTEXT(A2)), OR(ISNUMBER(B2), ISTEXT(B2))), IF(A2 = B2, "PASS", "FAIL"), "")

I would use:
=IF(AND(ISNUMBER(A1),ISNUMBER(B1),A1=B1),"Pass",IF(AND(A1<>"",B1<>"",A1=B1),"Pass","Fail"))

Related

Input data into a 2nd cell, based on the value of a 3rd cell? (Like "conditional formatting")

B1 is a checkbox. If checked B1=1. A1 can range from 0 to 10. If B1 is checked I want A1 to automatically = 10. Exactly like conditional formatting would turn it green. I cant put the formula =IF(B1=1,10,"") into A1 though because I need to be able to input other values in A1 without erasing the formula. I need to be able to reuse the sheet multiple times.
Ex.
A B
1 10 x
2 9
3 10 x
4 4
As Scott commented, you'd need to use VBA to do exactly what you're asking. A work-around, though, would be to add a third column with:
=IF(B1="x",10,A1)
In this case, Column A would be the user-inputted number, Column B would be your "x", and Column C would give the final output: 10 if B has "x", and the number from A otherwise.

How do I link the content of a cell to another worksheet as opposed to the value?

I realize my title doesn't really explain what I'm asking as I don't know the correct terminology but bear with me and I'll explain my question.
I know how to link two cells so that if one changes, the other does as well (i.e. cell C3 is linked to cell E5 by selecting cell C3 and entering "=E5"). But how do I link the information in the cell to another cell?
If my worksheet looks like this:
cell B1 - Grapes, cell C1 - 50
cell B2 - Apples, cell C2 - 60
and I link cell F1 to cell C2 with "=C2". If I change the order of cell B1 and cell B2 to become alphabetical then cell F1 is no longer linked to the value in cell C2 (50) but changes to the value that now becomes cell C2 (60). How do I link cell F1 to the actual value (50) in cell C2 even if the order changes.
Help... Thank you!
Not sure if this is an efficient method; if i correctly understood your question then you can use = to link two cells For example:
Sheet one can look like this
A B C D E
1 1 2 3 4 5
2 5 4 3 2 1
3 1 2 3 4 5
Total 7 8 9 10 11
Sheet two requires cell links so you do:
TotalForA =Sheet1!A4 //output will be 7
TotalForB =Sheet1!B4 //output will be 8
.
.
.
In a simple word you can use = sign and click on whatever cell you're like to get.

IF formula returning 0 or 1 depending on values in 3 cells?

I'm a beginner in Excel and I've been trying to make an IF formula that will return 0 or 1 if certain conditions are met.
The formula in A3 must look at
A1 to see if A1=1111
A2 to see if A2=21,00
A2 to see if A2=24,00.
So, if A1=1111 and A2=21,00 or 24,00 the result in A3 must be 1, but if A1=1111 and A2 is any other value, A3 must be 0. LE: If in other rows the value is 1112 the formula should return 1.
Yes, use and as well as or -
=IF(AND(A1=1111,OR(A2=21,A2=24))=TRUE,1,0)
Per comments, to add more arguments, just expand the first test for the and with an or -
=IF(AND(OR(B3=1111,B3=1112,B3=1113,B3=5555),OR(C3=21,C3=22.4))=TRUE,1,0)
update
=IF(B3<>1111,1,IF(AND(B3=1111,OR(C3=21,C3=22.4))=TRUE,1,0))

Excel formula - if one cell equals another then add

Example
A-------B------C------D
20------?------75-----2
22------?------23-----3
23------?------25-----5
24------?------20-----1
50------?------36-----2
36------?------22-----4
75------?------12-----1
If cell 1(75) from column C searches column A, if it finds 75 then enter column D cell 1(2) into column B cell 1.
Repeat until column C is finished.
Please forgive me, I've never done this.
This should do it:
=IF(VLOOKUP(C1,$A$1:$A$7,1,FALSE),D1)
paste that formula into b1 thru b7 and it should update references
OK, given your comment about the 2 next to 75 from column D needs to go int column B to the right of the 75, and also incorporating error checking code from Pankaj, try this one:
=IF(ISERROR(VLOOKUP(A1,$C$1:$D$7,2,FALSE)), "", VLOOKUP(A1,$C$1:$D$7,2,FALSE))

Change value in a cell based on value in another cell

Searched for this but could not find a way to do it.
I would like to be able to transform a value in one cell to another value in a different cell like this:
When cells in Column A contain Y set same number cells in Column B to Male or when cells in Column A contains N set same number cells in Column B value to Female.
For instance:
A2 = Y then B2 = Male
A2 = N then B2 = Female
=IF(A2="Y","Male",IF(A2="N","Female",""))
by typing yes it wont charge taxes, by typing no it will charge taxes.
=IF(C39="Yes","0",IF(C39="no",PRODUCT(G36*0.0825)))
If you want to do something like the following example, you'd have to use nested ifs.
If percentage is greater than or equal to 93%, then corresponding value in B should be 4 and if the percentage is greater than or equal to 90% and less than 92%, then corresponding value in B to be 3.7, etc.
Here's how you'd do it:
=IF(A2>=93%, 4, IF(A2>=90%, 3.7,IF(A2>=87%,3.3,0)))

Resources