+ Reply to Thread
Results 1 to 2 of 2

Is there a better way to perform this function?

  1. #1
    Registered User
    Join Date
    08-14-2007
    Posts
    1

    Is there a better way to perform this function?

    I have several ranges of extensions and need to create the full number for hundreds of entries in a spreadsheet. For example extensions between 2225 and 2324 = 267-ext while 3700 thru 3799 = 302-ext.

    Here is my list of extensions and full number to join to it:
    2225 - 2324 = (409) 267-ext
    3700 - 3799 = (409) 302-ext
    3800 - 3999 = (409) 900-ext

    I want to be able to put in the extension and have the next field create the full number.

    Is there a better function to do this than the one listed below?
    IF((AND(G392>=2225,G392<=2324)),"(409) 267-"&G392,IF((AND(G392>=3700,G392<=3799)),"(409) 302-"&G392,IF((AND(G392>=3800,G392<=3999)),"(409) 900-"&G392

    Thanks ahead of time.

  2. #2
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898
    Another way could be to create yourself a little lookup table.

    e.g.
    Please Login or Register  to view this content.
    These show the bottom ranges and the corresponding extension

    Then use a formula

    =LOOKUP(G392,$J$1:$K$3)&"-"&G392

    where J1:K3 contains the lookup table above

    Edit: Made table range absolute so that it won't change if formula copied down.
    Last edited by NBVC; 08-14-2007 at 04:42 PM.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

+ 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