+ Reply to Thread
Results 1 to 6 of 6

IF Function

  1. #1
    Registered User
    Join Date
    03-18-2011
    Location
    Glendale, Oregon
    MS-Off Ver
    Excel 2007
    Posts
    1

    IF Function

    I am building a spreadsheet that will put an "X" in the appropriate column that corresponds with the person's age.
    For example: If the person is 15, I want excel to put an "x" in the Age 10-19 column. If they are 45, put an "x" in the the Age 40-49 column.
    How do I write this formula??? I have tried an IF Function, but cannot get it to recognize the range (10-19, 40-49).

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,420

    Re: IF Function

    It will help others to help you if you post a sample workbook with some typical data and worksheet structure.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


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

    Re: IF Function

    Something like (for age 10 and up):

    =IF(LEFT(age cell)=LEFT(header,1),"X","")

    age cell is the cell containing the person's age

    header is the cell containing the age range

    or simplified version:

    =IF(LEFT(age cell)=LEFT(header),"X","")
    Last edited by Cutter; 03-18-2011 at 07:13 PM.

  4. #4
    Registered User
    Join Date
    05-04-2010
    Location
    Alberta, Canada
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: IF Function

    It seems to me like this is very similar to the problem I posted regarding the points of a compass and wind speed. (Posted today)

    If you read my thread, Showing degrees of wind direction as compass point initials
    there are some solutions and even a table you could adapt (posted by Cutter) to solve your problem.
    Last edited by bcsapper; 03-18-2011 at 09:31 PM.

  5. #5
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,351

    Re: IF Function

    Hi Kristinao and welcome to the forum.

    See the attached where I believe I have what you want.
    Attached Files Attached Files
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    16,053

    Re: IF Function

    Or maybe this:
    Attached Files Attached Files
    Never use Merged Cells in Excel

+ 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