+ Reply to Thread
Results 1 to 5 of 5

Formula to get a value based on 2 cells data

  1. #1
    Registered User
    Join Date
    09-08-2010
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    16

    Question Formula to get a value based on 2 cells data

    I searched the forum and did not find an answer to this, so I'm asking for advice on how to achieve the following:

    I have 3 columns, A and B for the values (which only accept S or N as values) and C, that will return a value based on the values on A and B

    IF A and B have "S", C will have IN
    IF A or B have "N", C will have OUT (in this case if either A or B also are "blank" it will result in OUT on C)

    As an example here goes a link
    https://docs.google.com/spreadsheet/...nR1d3VEQ0RfMFE

    Sorry if i was not too clear, ask any questions.

    Thank you!!
    Last edited by rfcapinto; 05-31-2012 at 05:29 PM.

  2. #2
    Forum Guru
    Join Date
    08-05-2004
    Location
    NJ
    MS-Off Ver
    365
    Posts
    13,582

    Re: Formula to get a value based on 2 cells data

    =IF(A2="S",B2="S","IN",IF(COUNTA(A2:B2)>=1,"Out","") dragged down
    Does that work for you?
    ChemistB
    My 2?

    substitute commas with semi-colons if your region settings requires
    Don't forget to mark threads as "Solved" (Edit First post>Advanced>Change Prefix)
    If I helped, Don't forget to add to my reputation (click on the little star at bottom of this post)

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

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

    Re: Formula to get a value based on 2 cells data

    Try

    =IF(COUNTIF(A2:B2,"S")=2,"IN",IF(COUNTIF(A2:B2,"N"),"OUT",""))

  4. #4
    Registered User
    Join Date
    09-08-2010
    Location
    Portugal
    MS-Off Ver
    Excel 2003
    Posts
    16

    Re: Formula to get a value based on 2 cells data

    Quote Originally Posted by Cutter View Post
    Try
    =IF(COUNTIF(A2:B2,"S")=2,"IN",IF(COUNTIF(A2:B2,"N"),"OUT",""))
    This one did the job,

    thank you!

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

    Re: Formula to get a value based on 2 cells data

    You're welcome.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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