+ Reply to Thread
Results 1 to 16 of 16

Help: IF formula: Cell value based on entered values of two other cells...

  1. #1
    Registered User
    Join Date
    04-10-2016
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Help: IF formula: Cell value based on entered values of two other cells...

    Situation: Ages of two people are entered into cells A1 and B1. If either age is 60 or older, the value of cell C1 should be "AGE". If either value is 59 or younger, the value should be "NA". If no age is available for A1 or B1, "NA" is entered manually.

    Problem: If A1<60 and B1 = "NA", C1 returns "AGE".

    Formula: IF(A1="NA","NA",IF(A1>=60,"AGE",IF(B1>=60,"AGE",IF(A1<60,"NA",IF(B1<60,"NA")))))

    I know that the formula I have does not recognize text (ie. "NA"), therefore it is ignoring the manually entered "NA". Any help making this work would be appreciated. I've tried to craft AND, OR and various IF formulas to no avail.

  2. #2
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    try ... =IF(OR(A1>59,B1>59),"AGE","NA")
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    sorry, I think I misread all your conditions so I came up with this instead... =IF(OR(A1="na",B1="na"),"NA",IF(OR(A1>=60,B1>=60),"AGE","NA"))

    EDIT: works better incase of decimals.
    Last edited by Sam Capricci; 04-10-2016 at 09:25 PM.

  4. #4
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    try this...

    =IF(AND(COUNT(A1:B1)=2,MAX(A1:B1)>=60),"Age","N/A")

  5. #5
    Registered User
    Join Date
    04-10-2016
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    Sambo & Phuocam... thx for the suggestions but neither of these work. When i use the formulas, if A1>60 and B1=NA, C1 returns "NA".

    C1 should return "AGE" if A1 or B1 is 60>=. C1 should return "NA" if both A1 and B1 are NA or... of both are 60<

    Any other thoughts or suggestions?

  6. #6
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    try the changed formula of sambo kid

    =IF(AND(A1="na",B1="na"),"NA",IF(OR(A1>=60,B1>=60),"AGE","NA"))
    Notice my main language is not English.

    I appreciate it, if you reply on my solution.

    If you are satisfied with the solution, please mark the question solved.

    You can add reputation by clicking on the star * add reputation.

  7. #7
    Registered User
    Join Date
    04-10-2016
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    Still the same result.

    Any other ideas?

    I'm surprised that this is proving so difficult with all of the complicated formulas I have seen elsewhere.

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    How about posting SEVERAL examples that cover every possible combination and show us what results you expect.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Forum Expert
    Join Date
    05-30-2012
    Location
    The Netherlands
    MS-Off Ver
    Office 365
    Posts
    14,987

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    Do you mean N/A (not available) instead of na?

    Please post your excel file, without confidential information.

  10. #10
    Registered User
    Join Date
    04-10-2016
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5
    Quote Originally Posted by Tony Valko View Post
    How about posting SEVERAL examples that cover every possible combination and show us what results you expect.
    Examples of what I want...
    A1 B1 C1
    60 NA AGE
    59 60 AGE
    60 59 AGE
    NA NA NA
    59 NA NA

    The values for cells A1 & B1 are entered manually, including "NA," which represents "Not Applicable."

  11. #11
    Registered User
    Join Date
    04-10-2016
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    5
    Quote Originally Posted by XL***** View Post
    Examples of what I want...
    A1 B1 C1
    60 NA AGE
    59 60 AGE
    60 59 AGE
    NA NA NA
    59 NA NA

    The values for cells A1 & B1 are entered manually, including "NA," which represents "Not Applicable."
    Also...
    59 59 NA

  12. #12
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    based on what you've written my post #3 should work unless there is a hidden space in the cell.

  13. #13
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,498

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    I would say that oldere and Tony are asking you to post a sample spreadsheet with the data so we can see what we are dealing with.

  14. #14
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,178

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    Try

    =IF(OR(AND(ISNUMBER(A2),A2>59),AND(ISNUMBER(B2),B2>59)),"AGE","NA")

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    Try this...

    Data Range
    A
    B
    C
    1
    60
    NA
    AGE
    2
    59
    60
    AGE
    3
    60
    59
    AGE
    4
    NA
    NA
    NA
    5
    59
    NA
    NA
    6
    ------
    ------
    ------


    This formula entered in C1 and copied down:

    =IF(COUNT(A1:B1)=0,"NA",IF(AND(COUNT(A1:B1),COUNTIF(A1:B1,">=60")),"AGE","NA"))

  16. #16
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: Help: IF formula: Cell value based on entered values of two other cells...

    Quote Originally Posted by XL***** View Post
    Examples of what I want...
    A1 B1 C1
    60 NA AGE
    try this...
    =IF(MAX(A1:B1)>=60,"AGE","NA")

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 03-22-2016, 04:58 PM
  2. Replies: 2
    Last Post: 03-20-2016, 04:54 AM
  3. [SOLVED] Formula to set text values in a cell based on a number entered in another cell
    By Osmer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 11-20-2015, 02:26 AM
  4. [SOLVED] Rename tabs based on values entered in specific cells
    By rshnkmr39 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2013, 06:55 AM
  5. [SOLVED] Formula to add values in cells depending on what text is entered in other cells
    By Kayaness in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 05-09-2013, 05:31 AM
  6. Increase formula by 1 row when original cell contents are not constant
    By Tulip1968 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 07-30-2012, 11:23 AM
  7. [SOLVED] can excel draw a shape based on values entered in cells
    By Milo in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-05-2005, 09:06 PM

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