+ Reply to Thread
Results 1 to 8 of 8

Please help me with a formula

  1. #1
    Registered User
    Join Date
    11-25-2005
    Posts
    18

    Please help me with a formula

    if anything is in cell A1 AND in cell B1 then show "ab" in cell C1
    if anything is in cell A1 and NOT in cell B1 then show "a" in cell C1
    if nothing is in cell A1 and IS in cell B1 then show "b" in cell C1
    if nothing is in either cell A1 or B1 then show "ab" in cell C1

    Whats the formala I need to put in C1 to make the above rules work?

    Thankinoo.

    AJ

  2. #2
    Niek Otten
    Guest

    Re: Please help me with a formula

    =IF(A1="","","a")&IF(B1="","","b")

    --
    Kind regards,

    Niek Otten

    "Smeeg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > if anything is in cell A1 AND in cell B1 then show "ab" in cell C1
    > if anything is in cell A1 and NOT in cell B1 then show "a" in cell C1
    > if nothing is in cell A1 and IS in cell B1 then show "b" in cell C1
    > if nothing is in either cell A1 or B1 then show "ab" in cell C1
    >
    > Whats the formala I need to put in C1 to make the above rules work?
    >
    > Thankinoo.
    >
    > AJ
    >
    >
    > --
    > Smeeg
    > ------------------------------------------------------------------------
    > Smeeg's Profile:
    > http://www.excelforum.com/member.php...o&userid=29099
    > View this thread: http://www.excelforum.com/showthread...hreadid=488206
    >




  3. #3
    Bob Phillips
    Guest

    Re: Please help me with a formula

    =IF(OR(AND(A1="",B1=""),AND(A1<>"",B1<>"")),"ab",IF(AND(A1<>"",B1=""),"a","b
    "))

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Smeeg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > if anything is in cell A1 AND in cell B1 then show "ab" in cell C1
    > if anything is in cell A1 and NOT in cell B1 then show "a" in cell C1
    > if nothing is in cell A1 and IS in cell B1 then show "b" in cell C1
    > if nothing is in either cell A1 or B1 then show "ab" in cell C1
    >
    > Whats the formala I need to put in C1 to make the above rules work?
    >
    > Thankinoo.
    >
    > AJ
    >
    >
    > --
    > Smeeg
    > ------------------------------------------------------------------------
    > Smeeg's Profile:

    http://www.excelforum.com/member.php...o&userid=29099
    > View this thread: http://www.excelforum.com/showthread...hreadid=488206
    >




  4. #4
    Bob Phillips
    Guest

    Re: Please help me with a formula

    Smartypants :-))


    "Niek Otten" <[email protected]> wrote in message
    news:[email protected]...
    > =IF(A1="","","a")&IF(B1="","","b")
    >
    > --
    > Kind regards,
    >
    > Niek Otten
    >
    > "Smeeg" <[email protected]> wrote in
    > message news:[email protected]...
    > >
    > > if anything is in cell A1 AND in cell B1 then show "ab" in cell C1
    > > if anything is in cell A1 and NOT in cell B1 then show "a" in cell C1
    > > if nothing is in cell A1 and IS in cell B1 then show "b" in cell C1
    > > if nothing is in either cell A1 or B1 then show "ab" in cell C1
    > >
    > > Whats the formala I need to put in C1 to make the above rules work?
    > >
    > > Thankinoo.
    > >
    > > AJ
    > >
    > >
    > > --
    > > Smeeg
    > > ------------------------------------------------------------------------
    > > Smeeg's Profile:
    > > http://www.excelforum.com/member.php...o&userid=29099
    > > View this thread:

    http://www.excelforum.com/showthread...hreadid=488206
    > >

    >
    >




  5. #5
    Registered User
    Join Date
    11-25-2005
    Posts
    18
    thanks for that peeps.

    I knew had something to do with nested IFs, but didn't know how to add the 'and's or 'or's :D

    Smeeg

  6. #6
    Registered User
    Join Date
    11-25-2005
    Posts
    18
    Ooops, I made a mistake in my last rule! sorry...

    if anything is in cell A1 AND in cell B1 then show "ab" in cell C1
    if anything is in cell A1 and NOT in cell B1 then show "a" in cell C1
    if nothing is in cell A1 and IS in cell B1 then show "b" in cell C1
    if nothing is in either cell A1 or B1 then show "ba" in cell C1

    Whats the formala I need to put in C1 to make the above rules work?

    Thankinoo.

    AJ

  7. #7
    Niek Otten
    Guest

    Re: Please help me with a formula

    =IF(AND(A1="",B1=""),"ba",IF(A1<>"","a","")&IF(B1<>"","b",""))

    --
    Kind regards,

    Niek Otten

    "Smeeg" <[email protected]> wrote in
    message news:[email protected]...
    >
    > Ooops, I made a mistake in my last rule! sorry...
    >
    > if anything is in cell A1 AND in cell B1 then show "ab" in cell C1
    > if anything is in cell A1 and NOT in cell B1 then show "a" in cell C1
    > if nothing is in cell A1 and IS in cell B1 then show "b" in cell C1
    > if nothing is in either cell A1 or B1 then show "ba" in cell C1
    >
    > Whats the formala I need to put in C1 to make the above rules work?
    >
    > Thankinoo.
    >
    > AJ
    >
    >
    > --
    > Smeeg
    > ------------------------------------------------------------------------
    > Smeeg's Profile:
    > http://www.excelforum.com/member.php...o&userid=29099
    > View this thread: http://www.excelforum.com/showthread...hreadid=488206
    >




  8. #8
    Registered User
    Join Date
    11-25-2005
    Posts
    18
    thanks again for the quick reply - but I'm an idiot. I was trying to be clever by saying put result a, b, ab, ba. but thats not what I really wanted. Sorry to be a pain, but this is exactly what I need, rather than just vague example. the formula's you have provided seem to stick 'a' and 'b' together when the results needed to be 'ab' but thats not quite what I wanted :D


    if anything is in cell A1 AND in cell B1 then show "ok" in cell C1
    if anything is in cell A1 and NOT in cell B1 then show "add order" in cell C1
    if nothing is in cell A1 and IS in cell B1 then show "add client" in cell C1
    if nothing is in either cell A1 or B1 then show "add client add order" in cell C1

    thanks again,

    Smeeg

+ 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