+ Reply to Thread
Results 1 to 3 of 3

Lookup Query - Occurrences

  1. #1
    Registered User
    Join Date
    10-23-2007
    Posts
    80

    Lookup Query - Occurrences

    Hi there,

    I'm struggling with a look-up type thing that I have on my worksheet. I have a table that lists the months of the year down from cell A2:A13, and days of the week along row from cell B1:H1. The data in between (cell B2:H13) is pulled through from elsewhere in the workbook and is in number format.

    What I basically want to do is create another worksheet with the months of the years listed down column A, and in column B, for each month, I want the first day of the week where the value in the original table is more than zero, and in column C the second day of the week where the value is more than zero. I really hope that makes sense, was quite difficult to explain!

    Many thanks

    Leanne
    Last edited by lealea1982; 10-16-2008 at 10:34 AM.

  2. #2
    Forum Expert daddylonglegs's Avatar
    Join Date
    01-14-2006
    Location
    England
    MS-Off Ver
    Microsoft 365
    Posts
    14,695
    Hello Leanne,

    Assuming your data is in a worksheet called data, and that your list of months (in the same order) is in report worksheet, also in A2:A13 then try using this "array formula" in B2

    =IF(COLUMNS($B2:B2)>COUNTIF(data!$B2:$H2,">0"),"",INDEX(data!$B$1:$H$1,SMALL(IF(data!$B2:$H2>0 ,COLUMN(data!$B2:$H2)-COLUMN(data!$B2)+1),COLUMNS($B2:B2))))

    confirmed with CTRL+SHIFT+ENTER and copy down column and across as far as needed, when you run out of days where the value is above zero you get blanks

  3. #3
    Registered User
    Join Date
    10-23-2007
    Posts
    80
    Perfect!! Thank you very much. :-)

+ 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. Technical Lookup & DCount Query
    By Alexander_Read in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-08-2008, 07:01 AM
  2. Lookup Query
    By svn_pie in forum Excel General
    Replies: 11
    Last Post: 01-09-2008, 05:35 PM
  3. If and lookup query
    By khalid79m in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 10-26-2007, 09:10 AM
  4. Excel query and parameters
    By urbanmojo in forum Excel General
    Replies: 1
    Last Post: 07-23-2007, 12:17 AM
  5. Lookup query
    By Clash in forum Excel General
    Replies: 5
    Last Post: 05-09-2007, 03:47 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