+ Reply to Thread
Results 1 to 7 of 7

Array formula query: How to do a mini look up?

  1. #1
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,015

    Array formula query: How to do a mini look up?

    Hi,

    I'd usually do a vlookup for this but i'm trying to expand my excel know how so I figured i'd attempt an array formula. I'd like a cell to return a number based on the quarter selected in another cell. Cell B3 is a drop down where you can only select Quarters 1-4. How do I create a formula to return the number 3-6 dependant on the quarter selected in B3? I've had a bash and come up with the following which just pastes it into the cell like text.

    {=LOOKUP(B3,{Quarter 1,Quarter 2,Quarter 3,Quarter 4},{3,4,5,6})}

    Admittedly I don't really know what i'm doing so i'd be grateful if someone could point out where i'm going wrong?

    Thanks,

    Snook
    Last edited by The_Snook; 08-28-2012 at 05:44 AM.

  2. #2
    Forum Expert Colin Legg's Avatar
    Join Date
    03-30-2008
    Location
    UK
    MS-Off Ver
    365
    Posts
    1,256

    Re: Array formula query: How to do a mini look up?

    Hi,

    Your formula looks pretty good except that it doesn't need to be CSE enterted and the quarters need to be surrounded by "" because they're strings.

    Formula: copy to clipboard
    Please Login or Register  to view this content.


    If B3 is empty then the formula returns #N/A.
    Hope that helps,

    Colin

    RAD Excel Blog

  3. #3
    Registered User
    Join Date
    02-03-2010
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: Array formula query: How to do a mini look up?

    is it fine?

    {=LOOKUP(B3,{1,2,3,4},{3,4,5,6})}

  4. #4
    Forum Expert Kevin UK's Avatar
    Join Date
    12-07-2010
    Location
    Radstock, Somerset
    MS-Off Ver
    365
    Posts
    1,922

    Re: Array formula query: How to do a mini look up?

    Hi The_Snook

    =LOOKUP(B3,{"Quarter 1","Quarter 2","Quarter 3","Quarter 4"},{3,4,5,6})

    As colin said, you don't have to CSE. Put double quotes around text. I posted a link regarding the Lookup function this earlier this morning.

    http://support.microsoft.com/kb/324986

  5. #5
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,015

    Re: Array formula query: How to do a mini look up?

    Boom, it works a treat, cheers Col

    ---------- Post added at 10:44 AM ---------- Previous post was at 10:42 AM ----------

    Cheers for the link Kev i'll have a read at lunch.

  6. #6
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,729

    Re: Array formula query: How to do a mini look up?

    If you always want the quarter number +2 perhaps try

    =RIGHT(B3)+2
    Audere est facere

  7. #7
    Valued Forum Contributor
    Join Date
    09-09-2009
    Location
    Liverpool, England
    MS-Off Ver
    Excel 2021
    Posts
    1,015

    Re: Array formula query: How to do a mini look up?

    Good spot Daddylonglegs I hadn't noticed the relationship.

+ 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