+ Reply to Thread
Results 1 to 3 of 3

IF statement - result based on a number

  1. #1
    Forum Contributor
    Join Date
    10-13-2011
    Location
    Australia
    MS-Off Ver
    Office 16
    Posts
    329

    IF statement - result based on a number

    Hi I've attached simple file which I believe explains the outcome required.

    I'd like to place an if statement in column B that gives me results as outlined in column I and J.
    They are post codes, and dependant on the number each has a different outcome to display.

    Any help would be appreciated.
    thanks
    Attached Files Attached Files
    Last edited by Christopherdj; 08-12-2013 at 09:44 PM.

  2. #2
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: IF statement - result based on a number

    vlookup and some if functions can do the trick alone without having to do VBA...

    but for the sake of convenience...

    I added something... (A custom function)

    postcodes.xlsm


    I called it "PCode"
    so just like how you would use all other excel functions, you just need to reference the cell, and it will return if its north, east, or other.. as an example, the attached file, I have all of the rest of the rows filled with the function...


    and note.. this function can only work on that workbook.. unless you reference it correctly if used on another workbook..


    if this helps, press my star "*"
    don't worry, there's a lot of people that are far more confused than you
    but if you liked what i suggested. Click for me the "Add Reputation" - that way, we'd be both happy.

  3. #3
    Forum Expert
    Join Date
    10-09-2012
    Location
    Dallas, Texas
    MS-Off Ver
    MO 2010 & 2013
    Posts
    3,049

    Re: IF statement - result based on a number

    Vlookups are the most convenient solution in my opinion.

    Recreate your Reference (or legend as you call it) with a beg point, and end point and a cateogory as shown in my simple example.
    postcodes.xlsx
    The only issue is some of the postcodes in column A are number and some are text, so I converted them all to numbers with TEXT TO COLUMNS then my vlookup in column C works as designed.
    Please ensure you mark your thread as Solved once it is. Click here to see how.
    If a post helps, please don't forget to add to our reputation by clicking the star icon in the bottom left-hand corner of a post.

+ 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: 5
    Last Post: 06-21-2013, 10:40 AM
  2. [SOLVED] Need help on VLookup to find result based on desired number
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-16-2013, 08:54 PM
  3. If then statement. Want the result to display the number in another cell.
    By Thecellxchange in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 01-05-2013, 05:02 PM
  4. Adjust Result based on Variable Row Number
    By leewad in forum Excel General
    Replies: 2
    Last Post: 03-10-2011, 08:16 AM
  5. Returning a result based on an age in number of days
    By MattGriff in forum Excel General
    Replies: 2
    Last Post: 01-14-2010, 10:24 AM

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