+ Reply to Thread
Results 1 to 5 of 5

HLookup with Count

  1. #1
    Registered User
    Join Date
    02-14-2008
    Posts
    48

    HLookup with Count

    Hi, hoping someone can help me please. I want to be able to reference the current month on a separate sheet and count the relevent rows against the relevant month, so if the current month is May 15, I want be able to look up May 15 and count how many rows against each section, e.g. how many rows in MPG for May 2015 (answer = 5). I've attached a sample spreadsheet.
    Many thanks in advance.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: HLookup with Count

    What happens if a row contains 0 or blank against the month, does it get counted or not?
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    02-14-2008
    Posts
    48

    Re: HLookup with Count

    I want to count every row that contains a number even if it's 0

  4. #4
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,064

    Re: HLookup with Count

    Then the month is immaterial since MPG has 5 rows for EVERY month

    Try this
    =COUNTIF(Data!A1:V1,TEXT(A1,"mmm yyyy"))*COUNTIF(Data!A2:A39,"MPG")

    If the month does not exist in the top row then the result will be zero otherwise the number of rows will be counted.
    NOTE: Your month in sheet "Current Month" is a date but the month headings in data are actually text, hence the TEXT conversion.

  5. #5
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: HLookup with Count

    AS MPG is in Colum A it (apparently) applies to ALL months in your sample why is the figure for May different to any other. I note in December there is a blank cell in one of the MPG rows: does this mean the count of MPG for December is 4?

+ 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. HLOOKUP Help. HLOOKUP links to Drop down list problems
    By finalmike in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-02-2013, 07:08 PM
  2. Count if, through HLookup + VLookup - OR - Macro
    By chetan.thakkar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-16-2010, 08:08 PM
  3. HLOOKUP in HLOOKUP, Base Estimate Table in Excel
    By gqdallas in forum Excel General
    Replies: 20
    Last Post: 10-19-2009, 01:41 PM
  4. HLOOKUP and Count Problem
    By SamuelT in forum Excel General
    Replies: 4
    Last Post: 01-27-2009, 10:10 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