+ Reply to Thread
Results 1 to 10 of 10

Need help with formula to return text value based on a number in a range.

  1. #1
    Registered User
    Join Date
    11-21-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Need help with formula to return text value based on a number in a range.

    I have a trial balance with account numbers and a mapping file with account ranges and their corresponding description. So for example, if the GL account is between 100000 and 102042 it should be Cash. I want to create a formula that will look at each account in the TB and return the line description based on the range in the mapping file.

    My files look something like this (in excel format)

    Mapping File:
    CASH & CASH EQUIVALENTS - Between 100000 and 102042
    MARKETABLE SECURITIES - Between 102043 and 110999
    Trial balance:
    101108 Current RMB-COB Shan
    102043 Other Investments

    Is there a formula that I can use to determine if the account number falls within different ranges and if it does return the text description for that range. I have a 5000 account GL so doing it one by one is very time consuming.

  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,499

    Re: Need help with formula to return text value based on a number in a range.

    something like this could work...
    =IF(AND(A1>99999,A1<102043),"Cash & Cash Equivalents",IF(AND(A1>102042,A1<111000),"Marketable Securities",""))
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  3. #3
    Registered User
    Join Date
    11-21-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need help with formula to return text value based on a number in a range.

    I should have mentioned, I have a list of about 300 descriptions. So writing each one defeats the purpose of trying the formula. Is there a way to reference the range with the description?

  4. #4
    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,499

    Re: Need help with formula to return text value based on a number in a range.

    You could put them into a table and do lookups on them.

    EDIT: can you post a sample spreadsheet? A vlookup might work.
    Last edited by Sam Capricci; 03-06-2014 at 03:57 PM.

  5. #5
    Registered User
    Join Date
    11-21-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need help with formula to return text value based on a number in a range.

    Can't figure out how to post the actual spreadsheet as an example, so this screenshot is the best I can do (please tell me how to attach excel file, if that's possible)Capture.JPG

  6. #6
    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,499

    Re: Need help with formula to return text value based on a number in a range.

    Here is an example of a vlookup as a reference, you just substitute your values for those in col B and the outputs you want in col C. A vlookup that uses "TRUE" needs to be sorted ascending on values to work.

    EDIT: the way to attach a spreadsheet is to "Go Advanced" at the bottom then look for the "Manage Attachments" button.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    11-21-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need help with formula to return text value based on a number in a range.

    Thank you for your help so far. I'm not sure a Vlookup is going to get me where I need to be.

    See attached file. On the second tab, I want column C to show me the description based on the first tab (col A) derived from the account number falling within the range for that description.
    Attached Files Attached Files

  8. #8
    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,499

    Re: Need help with formula to return text value based on a number in a range.

    see if this is what you need. Had to convert the cells in col A of trial balance to numbers and had to move the cells in col A to col D in the mapping range but it looks like it worked.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    11-21-2013
    Location
    Boston, MA
    MS-Off Ver
    Excel 2010
    Posts
    7

    Re: Need help with formula to return text value based on a number in a range.

    Wow, I guess I was expecting this to be more complex that it really is. I didn't think that a vlookup function would be able to determine if the number was within the given range. Thank you so much for your help.

  10. #10
    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,499

    Re: Need help with formula to return text value based on a number in a range.

    You're welcome and thanks for the bump to my reputation.
    don't forget to mark the post as solved using the thread tools at the top of the post if you haven't already.

+ 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. [SOLVED] IF function to return a number value based on various text options
    By metrohike in forum Excel Formulas & Functions
    Replies: 31
    Last Post: 02-28-2014, 04:47 AM
  2. Replies: 1
    Last Post: 07-18-2013, 10:11 AM
  3. Replies: 6
    Last Post: 12-07-2012, 12:47 PM
  4. Replies: 3
    Last Post: 03-29-2012, 05:28 PM
  5. Formula to return a value based on a range of sale
    By maileen22 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-01-2010, 09:38 AM

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