+ Reply to Thread
Results 1 to 10 of 10

Vlookup & count

Hybrid View

  1. #1
    Registered User
    Join Date
    07-23-2012
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    60

    Vlookup & count

    Dear All,

    I have attached one excel, Where Column B have Dates and Column C having month (Just by formatting the dates to show only month).

    Now i have per-populated month list in column H having months. I want output in Column I as # of Contracts for that particular month, which is nothing but count of same months in Column C matched against Months in Column H.

    (For ex. in Column I , Apr'14 should display 5 # of contracts)

    Please Help. VLOOKUP is not working since Column C method of extracting months is not working and Column C & Column H months not matching.

    Regards
    Mohammad
    Attached Files Attached Files

  2. #2
    Forum Expert Ace_XL's Avatar
    Join Date
    06-04-2012
    Location
    UAE
    MS-Off Ver
    2016
    Posts
    6,074

    Re: Vlookup & count

    You don't need Column C at all.

    In I2 use

    =SUMPRODUCT(--(TEXT($B$2:$B$11,"mmyy")=TEXT(H2,"mmyy")))
    Copy down
    Life's a spreadsheet, Excel!
    Say thanks, Click *

  3. #3
    Registered User
    Join Date
    07-23-2012
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    60

    Re: Vlookup & count

    Thanks a lot Ace. It is perfect.

    Now i need one more help , in the same excel I've added Column I "PO to delivery Average Days", where i require Average of Number of days for that particular month as mentioned in column D,

    I would appreciate your help.

    Regards
    Mohammad
    Attached Files Attached Files

  4. #4
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,641

    Re: Vlookup & count

    Apply this in C2 :

    =IF(ISNUMBER(B2),EOMONTH(B2,0),"")

    And in I2:

    =COUNTIF($C$2:$C$11,EOMONTH(H2,0))
    Quang PT

  5. #5
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Vlookup & count

    =sumproduct(--($h2=$c$2:$c$11-day($c$2:$c$11)+1))
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  6. #6
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Vlookup & count

    I2=IFERROR(SUMPRODUCT(--(TEXT($B$2:$B$11,"mmyy")=TEXT(G2,"mmyy")),$D$2:$D$11)/H2,"")
    and copy towards down

  7. #7
    Registered User
    Join Date
    07-23-2012
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    60

    Re: Vlookup & count

    Hello nflsales, This works perfect but if you replace any of the Apr'14 PO delivery days to zero or make that cell empty , this formula still calculate average by Total number of Apr month ( 5), ideally it should take as 4 to calculate average.

    Regards
    Mohammad

  8. #8
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Vlookup & count

    sorry
    try this
    i2=IFERROR(SUMPRODUCT(--(TEXT($B$2:$B$11,"mmyy")=TEXT(G2,"mmyy")),$D$2:$D$11)/SUMPRODUCT(--(TEXT($B$2:$B$11,"mmyy")=TEXT(G2,"mmyy")),--($D$2:$D$11>0)),"")

  9. #9
    Registered User
    Join Date
    07-23-2012
    Location
    India
    MS-Off Ver
    Excel 2013
    Posts
    60

    Re: Vlookup & count

    Hello Nfls,


    Sorry to bother you again but i don't know why this is not working in my working file however it works well in test file. I have attached my working file for your review. Is it because of the ways PO to delivery days are calculated in Column D, where as in test file i've entered them as absolute number without using the formula.

    Please help.

    Regards
    Mohammad
    Attached Files Attached Files

  10. #10
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,937

    Re: Vlookup & count

    I2=IFERROR(SUMPRODUCT(--(TEXT($B$2:$B$1001,"mmyy")=TEXT(G2,"mmyy")),$D$2:$D$1001)/SUMPRODUCT(--(TEXT($B$2:$B$1001,"mmyy")=TEXT(G2,"mmyy")),--ISNUMBER($D$2:$D$1001)),"")
    Try this It will rectify your problem
    you have text in Column D, so that you got the wrong result
    the formula in Column D =IF(ISNUMBER(C2-B2),C2-B2,"") giving text "" in column D

+ 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. Vlookup / count
    By RO24 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-08-2014, 04:09 PM
  2. Count if & vlookup help
    By floricita in forum Excel General
    Replies: 11
    Last Post: 09-26-2011, 08:33 AM
  3. Count VLOOKUP #N/A
    By rdirvngjr in forum Excel General
    Replies: 5
    Last Post: 03-15-2011, 07:47 PM
  4. Help with count if and vlookup together.. maybe
    By Lpayne in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-24-2008, 01:38 PM
  5. [SOLVED] count &vlookup
    By marcie in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-28-2005, 11:06 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