+ Reply to Thread
Results 1 to 14 of 14

Lookups (Excel 2003)

  1. #1
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Lookups (Excel 2003)

    Hi all,

    I have some data, workbook attached. My data is structured akin to A1:C7. I have two requirements I am trying to pull out but I have to use 2003

    I am trying to pull out those names based on one criteria and then those names based on two criteria (examples shown). I know I could write an IF statement but I'm not sure how to present the returned values above one another.

    Can anyone help please?
    Attached Files Attached Files

  2. #2
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookups (Excel 2003)

    With one criteria

    =IFERROR(INDEX(A:A,SMALL(IF($B$2:$B$7="Yes",ROW($B$2:$B$7)),ROWS($A$1:A1))),"")

    With two criteria

    =IFERROR(INDEX(A:A,SMALL(IF($C$2:$C$7="Honda",IF($B$2:$B$7="Yes",ROW($C$2:$C$7))),ROWS($A$1:A1))),"")



    ...confirmed by pressing CTRL+SHIFT+ENTER to activate the array, not just ENTER. You will know the array is active when you see curly braces { } appear around your formula. If you do not CTRL+SHIFT+ENTER you will get an error or a clearly incorrect answer. Press F2 on that cell and try again.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  3. #3
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookups (Excel 2003)

    Try this...

    Data Range
    A
    B
    C
    D
    E
    F
    1
    Name
    Result
    Car
    ------
    Yes
    Yes + Honda
    2
    John
    Yes
    Ford
    John
    Bill
    3
    Dave
    No
    Renault
    Bill
    ****
    4
    Bill
    Yes
    Honda
    ****
    5
    Bob
    No
    Honda
    6
    Tony
    No
    Ford
    7
    ****
    Yes
    Honda


    This array formula entered in E2:

    =LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX(A:A,SMALL(IF(B$2:B$7="Yes",ROW(B$2:B$7)),ROWS(E$2:E2)))))

    Copy down until you get blanks.

    This array formula** entered in F2:

    =LOOKUP("zzzzz",CHOOSE({1,2},"",INDEX(A:A,SMALL(IF(B$2:B$7="Yes",IF(C$2:C$7="Honda",ROW(C$2:C$7))),ROWS(E$2:E2)))))

    Copy down until you get blanks.

    ** array formulas need to be entered using the key
    combination of CTRL,SHIFT,ENTER (not just ENTER).
    Hold down both the CTRL key and the SHIFT key
    then hit ENTER.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  4. #4
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Lookups (Excel 2003)

    Hi both,

    Fantastic. Tony I hope you don't mind I used AlKey's first as he replied sooner. Thank you. I added IF(ISERROR to your's Alkey and perfect. I need to remember that formula.

    Thank you!

  5. #5
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookups (Excel 2003)

    Looks like the forum censor doesn't like the name D*I*C*K.

    Thanks for the feedback!

  6. #6
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Lookups (Excel 2003)

    @ tony. Sorted.

  7. #7
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookups (Excel 2003)

    Thanks for the feedback!

    I forgot about Excel 2003

    Here is the alternative

    =IF(ROWS($B$1:B1)>COUNTIF($B$2:$B$7,"yes"),"",INDEX(A:A,SMALL(IF($B$2:$B$7="Yes",ROW($B$2:$B$7)),ROWS($A$1:A1))))

    =IF(ROWS($B$1:B1)>COUNTIFS($C$2:$C$7,"Honda",$B$2:$B$7,"yes"),"",INDEX(A:A,SMALL(IF($B$2:$B$7="Yes",IF($C$2:$C$7="Honda",ROW($B$2:$B$7))),ROWS($A$1:A1))))

  8. #8
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Lookups (Excel 2003)

    Thank you Alkey!!!

  9. #9
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookups (Excel 2003)

    The 2nd formula uses COUNTIFS. You'll have to use something else for Excel 2003, either SUMPRODUCT or SUM(IF.

  10. #10
    Forum Contributor
    Join Date
    08-23-2011
    Location
    England
    MS-Off Ver
    Excel 2010
    Posts
    404

    Re: Lookups (Excel 2003)

    Argh bummer. Had'nt gotten round to that one yet. Thank you for pointing that out Tony. Do I just replace the Count for Sum (i.e. direct replacement?)

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookups (Excel 2003)

    Replace:

    COUNTIFS($C$2:$C$7,"Honda",$B$2:$B$7,"yes")

    With:

    SUMPRODUCT(--($C$2:$C$7="Honda"),--($B$2:$B$7="yes"))

    However, why use this error trap:

    =IF(ROWS($B$1:B1)>SUMPRODUCT(--($C$2:$C$7="Honda"),--($B$2:$B$7="yes")),"",

    When this one will do:

    =LOOKUP("zzzzz",CHOOSE({1,2},"",


  12. #12
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Lookups (Excel 2003)

    Here is with SUM

    =IF(ROWS($B$1:B1)>SUM(--($B$2:$B$7="yes")),"",

    =IF(ROWS($B$1:B1)>SUM(--($B$2:$B$7="yes")*($C$2:$C$7="Honda")),"",

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Lookups (Excel 2003)

    Quote Originally Posted by AlKey View Post

    =IF(ROWS($B$1:B1)>SUM(--($B$2:$B$7="yes")*($C$2:$C$7="Honda")),"",
    No need for the double unary.

    SUM(($B$2:$B$7="yes")*($C$2:$C$7="Honda"))

  14. #14
    Forum Expert
    Join Date
    12-11-2011
    Location
    Netherlands
    MS-Off Ver
    office 365
    Posts
    3,322

    Re: Lookups (Excel 2003)

    You can also use a pivot table
    Attached Files Attached Files
    Willem
    English is not my native language sorry for errors
    Please correct me if I'm completely wrong

+ 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. Lookups in Excel 2007
    By Sammitry in forum Excel General
    Replies: 6
    Last Post: 06-07-2012, 03:55 AM
  2. [SOLVED] excel lookups
    By Bob in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-02-2005, 06:17 PM
  3. Replies: 2
    Last Post: 05-16-2005, 12:07 AM
  4. Replies: 1
    Last Post: 05-15-2005, 07:07 PM

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