+ Reply to Thread
Results 1 to 11 of 11

Basic 'IF' Statment Calc problems

  1. #1
    Registered User
    Join Date
    07-06-2010
    Location
    Beckenham
    MS-Off Ver
    Excel 2007
    Posts
    84

    Arrow Basic 'IF' Statment Calc problems

    Ok, I need to know how to calculate the following in 1 cell, cell C


    First Equation [I had this:=IF(OR(AND(A1=1,B1=1),OR(A1=1,B1=0)),1,0) but it doesn't work]

    Column A = 1
    Column B = 1

    Column C = 1

    Column A = 1
    Column B = 0

    Column C = 1

    Column A = 0
    Column B = 1

    Column C = 0

    Second Equation

    Column A = 1
    Column B = 1

    Column C = 0

    Column A = 1
    Column B = 0

    Column C = 0

    Column A = 0
    Column B = 1

    Column C = 1


    any help would be much appreciated! Cannot see the wood for the trees at the moment!!!!
    Last edited by AllenMead; 09-23-2010 at 04:35 PM.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Basic 'IF' Statment Calc problems

    Maybe:

    =IF(A1=1,1,0)

    and for 2nd formula

    =IF(AND(A1=0,B1=1),1,0)
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

  3. #3
    Registered User
    Join Date
    07-06-2010
    Location
    Beckenham
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Basic 'IF' Statment Calc problems

    Kind of, hopefully this may explain it better;

    IF
    ((A1=1, B1=1), then 1 or (A1=1, B1=0), then 1 or (A1=0, B1=1), then 0) As 1 Formula


    IF
    ((A1=1, B1=1), then 0 or (A1=1, B1=0), then 0 or (A1=0, B1=1), then 1) As 1 Formula
    Last edited by AllenMead; 09-23-2010 at 09:28 AM.

  4. #4
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Basic 'IF' Statment Calc problems

    What's the difference in the results between that and what I gave you?

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,320

    Re: Basic 'IF' Statment Calc problems

    Assuming B1 actually matters:
    =--AND(A1=1,OR(B1={0,1}))
    and:
    =--NOT(AND(A1=1,OR(B1={0,1})))
    Everyone who confuses correlation and causation ends up dead.

  6. #6
    Registered User
    Join Date
    07-06-2010
    Location
    Beckenham
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Basic 'IF' Statment Calc problems

    Quote Originally Posted by NBVC View Post
    What's the difference in the results between that and what I gave you?
    It's been one of those days! Trying to make it more complicated than it needs to be.

    In answer, yep, looks like what you have said is spot on. Thank you!

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Basic 'IF' Statment Calc problems

    You haven't said what you want for A=0 B=0

    So from what you did give for your first equation: C=A1 each time
    And for your second equation: IF(B1>A1,1,0)

  8. #8
    Registered User
    Join Date
    07-06-2010
    Location
    Beckenham
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Basic 'IF' Statment Calc problems

    Opps, A=0 B=0 then C=0

  9. #9
    Registered User
    Join Date
    07-06-2010
    Location
    Beckenham
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Basic 'IF' Statment Calc problems

    @romperstomper spot on except (my fault) if A and B=0 then C=0 and not 1

  10. #10
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: Basic 'IF' Statment Calc problems

    Then what I gave you still holds true.

  11. #11
    Registered User
    Join Date
    07-06-2010
    Location
    Beckenham
    MS-Off Ver
    Excel 2007
    Posts
    84

    Re: Basic 'IF' Statment Calc problems

    @ Cutter, yes chap and thank you for your help

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1