I want to write a spread sheet that has the following formula.
If cell A2 equals x and B2 equals x then C2 equals 1, if either A2 or B2 is zero then c2 equals zero. Can anyone help?
I want to write a spread sheet that has the following formula.
If cell A2 equals x and B2 equals x then C2 equals 1, if either A2 or B2 is zero then c2 equals zero. Can anyone help?
One way
VBA Noob=IF(COUNTIF(A2:B2,"x")=2,1,IF(COUNTBLANK(A2:B2)>=1,0,""))
_________________________________________
![]()
![]()
Credo Elvem ipsum etian vivere
_________________________________________
A message for cross posters
Please remember to wrap code.
Forum Rules
Please add to your signature if you found this link helpful. Excel links !!!
Hi,
If you mean to say that the value in A2 is the same in B2, then you can use in C2 : =IF((A2=B2),1,IF((A2<>B2),0))
Please note the my formula still needs some amendment when the values in A2 & B2 is 0, i do not know how to make this amendment
Thanks every body for further assistance
Regards
Perhaps
=IF(A2=B2,1,IF(OR(A2=0,B2=0),0,""))
paul that gives 1 for a2=0, b2=0 as thats true
=if(or(a2=0,b2=0),0,if(a2=b2,1,""))
Martin, extremely large values of -1 could be miscalculated by Excel due to binary math, causing the formula to give incorrect results.
Ok, just kidding. Good eye!![]()
That is kind of like the Second Derivative Test when you "check that each of these functions has precisely one critical point x = 0 and that at this point the second derivative is zero in all three cases." or is it .". or '. Can you show me code with complex formulas using a ReplaceIF?
Contextions, are you serious? If so, I apologize. That post was a complete joke based on the quote "2 + 2 = 5, for extremely large values of 2." Google™ it; you can even buy t-shirts and mugs.
Hence the "Just kidding... wink" bit.
Theoretically you could use excel to display 2 + 2 = 5 for large values of 2 if entries were rounded to nearest .5 < higher whole number, huh? We should make a new trademark with the code!
there's also this posibility:
![]()
=--AND(A1="x",B1="x")
Ben Van Johnson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks