+ Reply to Thread
Results 1 to 16 of 16

vlookup and countif?

  1. #1
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119

    vlookup and countif?

    Hi All,

    As you can see there are multiple sales advisors with different amounts of sales and with dates processed and outstanding sales that need processed (they are the ones without dates). I need a few formulas to find out how many sales each advisor has with dates, and how many they have outstanding without dates. Also another cell which tells you the amount they are processed (with dates). Hope this makes sense.

    I have tried countif's, lookups the lot but cant seem to get my head around it. Lookup doesnt work for me becasue the advisors will not always be in ascending order. Countif also does not work because it will just tell me how many sales an "individual advisor" has, but again i need them without the dates as well.

    thanks
    Attached Files Attached Files
    Last edited by thompsy121; 10-07-2008 at 02:21 PM.

  2. #2
    Forum Expert
    Join Date
    12-23-2006
    Location
    germany
    MS-Off Ver
    XL2003 / 2007 / 2010
    Posts
    6,326
    Hi and welcome to the board
    Depending on what you need a Pivot Table is a possible solution

    HTH
    Attached Files Attached Files

  3. #3
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    Hi,

    In the example you posted,

    B18=SUMIF(A2:A13,"Bob",B2:B13)

    B20=SUMPRODUCT((A2:A13="Bob")*(C2:C13<>"")*(B2:B13))

    B21=SUMPRODUCT((A2:A13="Bob")*(C2:C13="")*(B2:B13))
    Rule 1: Never merge cells
    Rule 2: See rule 1

    "Tomorrow I'm going to be famous. All I need is a tennis racket and a hat".

  4. #4
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    hi,

    thanks for that, never thought of that, once i have produced the pivot table, can it be hidden and can i copy individual results to other cells in the spreadsheet.

    thanks

  5. #5
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    or

    Count Bob & with dates =SUMPRODUCT((A2:A13="Bob")*(C2:C13<>""))

    Count Bob & without dates =SUMPRODUCT((A2:A13="Bob")*(C2:C13=""))

  6. #6
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    thanks for the formulas they work great. didn't even think abouyt sumif's

  7. #7
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    Right guys,

    I have used your formulas and i must admit im impressed. Now i have another question that may be quite tricky.

    In the cells i have highlighted yellow - the formula counts the non-blank cells. Obviously these will be date only fields i will input. Which is fine, however what if i add text into these cells. I then want it to not count that cell - example if i enter cancelled(as in file).

    Any advice on this one.

    Thanks
    Attached Files Attached Files

  8. #8
    Forum Expert sweep's Avatar
    Join Date
    04-03-2007
    Location
    Great Sankey, Warrington, UK
    MS-Off Ver
    2003 / 2007 / 2010 / 2016 / 365
    Posts
    3,454
    You can test to see if it's a number (which is how excel stores dates). In your example,


    I28=SUMPRODUCT((A1:A100="Tom A")*(ISNUMBER(C1:C100)))

  9. #9
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    Thanks for that, worked a treat. Coming along great now

  10. #10
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    Hi could some please comment on this one for me please. Please see attached file.

    1. If I delete a date in column C or enter text, below the number reduces by one (Apps on MLD). I.e. it is no longer being counted.

    2. I now need this to happen to columns O and R.

    Example in row 2 - Bob A has an application of £250, returned on 29/9, with MPPI and HC.

    If i deleted the date in C2, below in my table the results would change, as the condition has not been met, therefore cells O and R would not count them either.

    This works great using the ISNUMBER.

    However, when I enter text I.e (Cancelled) in cell C2, cell J24 removes one sale, however O24 and R24 stay the same.

    Help on this would be really appreciated.

    Thanks
    Attached Files Attached Files

  11. #11
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953
    I haven't followed the previous threads, but the formulas below require that the dates be entered/formatted as text.
    In K2:
    Please Login or Register  to view this content.
    In O2:
    Please Login or Register  to view this content.
    and, in R2
    Please Login or Register  to view this content.
    I replaced your team initials with the REPLACE() fn only to be able to drag-fill the formulas
    Ben Van Johnson

  12. #12
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    Thanks for that, everything is working how i need it now.

    Thanks everyone

  13. #13
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    Hi i need one last bit of help on this one.

    Please see attached file and comment.

    Column N shows the total amount of sales each advisor has, if I delete the date in column C for a certain advisor, beloew column N will automatically minus that amount. This also happens to the other columns which relate to that cell with the date deleted.

    On the rest of my cells, i have it doing the same calculation, but this time when i add text in stead of a date ...in this case is want to enter cancelled. When it enter text into column C, the rest of my figures update as the formulas have been put in place. But column N shows the same value.

    Here is my formula - =SUMPRODUCT((A6:A104="Tom A")*(C6:C104<>"")*(B6:B104))

    In my other cells i have used the ISNUMBER(DATEVALUE in my formula. Can this be added to the above formula as well.

    Thanks
    Attached Files Attached Files

  14. #14
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,953
    TRy this formula mod:
    Please Login or Register  to view this content.

  15. #15
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    Thanks for all your help, that worked a treat. I think it's finally complete now.

    Many thanks again, great forum.

  16. #16
    Forum Contributor thompsy121's Avatar
    Join Date
    09-25-2008
    Location
    Newcastle upon Tyne - UK
    MS-Off Ver
    Office 365
    Posts
    119
    H All,

    One final thing before it is complete. I now need to rank these figures to show which sales advisor has got the highest figures for certain cells. See attached file.

    Any suggestions would be appreciated.

    Thanks
    Attached Files Attached Files

+ 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. reverse vlookup?
    By tn80 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-17-2008, 11:08 PM
  2. countif problems...
    By moshmoshon in forum Excel General
    Replies: 2
    Last Post: 07-28-2007, 02:01 AM
  3. Vlookup query (aren't they always?)
    By ketchel in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 05-28-2007, 01:20 PM
  4. Replies: 3
    Last Post: 04-25-2007, 08:27 AM
  5. countif and Vlookup
    By sagar in forum Excel General
    Replies: 11
    Last Post: 02-13-2007, 10:10 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