View unanswered posts | View active topics
It is currently Fri May 23, 2025 8:43 pm
|
Page 1 of 1
|
[ 14 posts ] |
|
Author |
Message |
l3v1ck
What's a life?
Joined: Fri Apr 24, 2009 10:21 am Posts: 12700 Location: The Right Side of the Pennines (metaphorically & geographically)
|
I'm trying to combine two formulas without success, can anyone help?
=IsNumber(B6) =IF(C6=$B6,1,0)
What I'm wanting Excel to do is: Is there a number in B6? If not, leave cell blank, if there is do the following equation: If C6 is the same as B6, then the cell value should be 1, if it isn't, the cell value should be 0.
How do I get that to work? I've tried google, but I can't seem to find a way to combine the IsNumber and IF functions.
|
Mon May 23, 2011 9:07 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Yup there is but I'm not sure I fully understand the problem. Ah, ok... re-read. =IF(IsNumber(B6), if(C6 = B6, 1, 0), "") That should work.
|
Mon May 23, 2011 9:12 pm |
|
 |
l3v1ck
What's a life?
Joined: Fri Apr 24, 2009 10:21 am Posts: 12700 Location: The Right Side of the Pennines (metaphorically & geographically)
|
Thanks I'll give it a try.
|
Mon May 23, 2011 9:14 pm |
|
 |
l3v1ck
What's a life?
Joined: Fri Apr 24, 2009 10:21 am Posts: 12700 Location: The Right Side of the Pennines (metaphorically & geographically)
|
Tried it with and without the spaces inbetween characters, but the result is always blank.
|
Mon May 23, 2011 9:18 pm |
|
 |
l3v1ck
What's a life?
Joined: Fri Apr 24, 2009 10:21 am Posts: 12700 Location: The Right Side of the Pennines (metaphorically & geographically)
|
Ah. Your formula does work if the inputs are numbers. My inputs in B6 and C6 are letters. If the letters match I want it to put a 1 as teh cell value and a 0 if the don't.
|
Mon May 23, 2011 9:21 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Ah OK, this is opposite to your description though... If you want the comparison only to be with letters then... =IF(NOT(ISNUMBER(B5)), IF(C5=B5,1,0), "") This will only put a 1 or a 0 if there is a letter in B5. If the value in B5 is a number then the result will be blank. I'm not sure this does what you want though.
|
Mon May 23, 2011 9:26 pm |
|
 |
rustybucket
I haven't seen my friends in so long
Joined: Thu Jun 18, 2009 5:10 pm Posts: 5836
|
Looks right to me... ...but I'm using LibreOffice so I daredn't test it.
_________________Jim
|
Mon May 23, 2011 10:41 pm |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
Lol, I was using libre office also 
|
Tue May 24, 2011 6:34 am |
|
 |
l3v1ck
What's a life?
Joined: Fri Apr 24, 2009 10:21 am Posts: 12700 Location: The Right Side of the Pennines (metaphorically & geographically)
|
The formula seems fine. If I enter numbers in C5 and B5, it works exactly as it's supposed to. The problem I have now is that my inputs in C5 and B5 are letters. Excel seems to decide that it doesn't want to do the calculation if that's the case. Stupid bloody MS. I was a bit cheecky and tried: =IF(IsLetter(B6), if(C6 = B6, 1, 0), ""). Excel wasn't having any of it though.
|
Tue May 24, 2011 6:44 am |
|
 |
jonlumb
Spends far too much time on here
Joined: Thu Apr 23, 2009 6:44 pm Posts: 4141 Location: Exeter
|
Well use ISBLANK instead of ISNUMBER. If you need to distinguish between the two you're going to need to use nested IF statements
Edit: There is one minor caveat, in that if you have an IF statement or similar that puts the contents of "" into a cell, it will always fail an ISBLANK test.
_________________ "The woman is a riddle inside a mystery wrapped in an enigma I've had sex with."
|
Tue May 24, 2011 6:45 am |
|
 |
l3v1ck
What's a life?
Joined: Fri Apr 24, 2009 10:21 am Posts: 12700 Location: The Right Side of the Pennines (metaphorically & geographically)
|
I'm still not getting a result if I use that, but have letters as the inputs in cells B5 and C5. Stupid bloody Excel.
I could try using Excel 2007 on my PC rather than Excel 2007 on my laptop. But even if it works on 2007 it's pointless. People who I'm sending it to don't all use 2007.
|
Tue May 24, 2011 6:53 am |
|
 |
Fogmeister
I haven't seen my friends in so long
Joined: Thu Apr 23, 2009 7:35 pm Posts: 6580 Location: Getting there
|
OK, I'm at work now with proper Excel in front of me.
Could you explain again exactly what it is that you want the formula to do?
I'll have another go.
The first explanation said that it only wants to display 1 or 0 if B6 was a number but this seems to be not what you meant.
|
Tue May 24, 2011 7:55 am |
|
 |
big_D
What's a life?
Joined: Thu Apr 23, 2009 8:25 pm Posts: 10691 Location: Bramsche
|
Remove "Error" and replace it with "", once you have finished debugging. Or, if you are checking for not a number: Always test a positive first, even if the result you are after is not the positive, as checking for positives is much more efficient than searching for negatives. In Excel, you have to give actions for both true and false, so it doesn't make much difference to the formula. The "NOT" operative takes an extra couple of clock cycles to calculate, which isn't much nowadays and you won't notice any difference on one formula, but if that is spread over thousands of rows, it can make a huge difference! So it is something you should try and keep in mind, when writing formula.
_________________ "Do you know what this is? Hmm? No, I can see you do not. You have that vacant look in your eyes, which says hold my head to your ear, you will hear the sea!" - Londo Molari
Executive Producer No Agenda Show 246
|
Tue May 24, 2011 8:06 am |
|
 |
l3v1ck
What's a life?
Joined: Fri Apr 24, 2009 10:21 am Posts: 12700 Location: The Right Side of the Pennines (metaphorically & geographically)
|
Thanks. That seems to work. Thanks for all the suggestions guys.
|
Tue May 24, 2011 8:50 am |
|
|
|
Page 1 of 1
|
[ 14 posts ] |
|
Who is online |
Users browsing this forum: No registered users and 27 guests |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum
|
|