+ Reply to Thread
Results 1 to 8 of 8

Countifs referencing data from another worksheet in the same workbook

  1. #1
    Registered User
    Join Date
    03-23-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    4

    Countifs referencing data from another worksheet in the same workbook

    Hi

    I'm trying to use the countifs function where it's referencing data on another worksheet but within the same workbook.

    The worksheet which has my Countifs formula is "Analysis"
    The worksheet which has the data I'm referencing is "Leave"

    There are 2 sets of criteria I've used in the formula.

    =COUNTIFS(Leave!$C:$H,Analysis!$B2,Leave!$B:$B,Analysis!C$1)

    I however get a #VALUE! error. Having google'd this error, it advises that it results from the data referenced being from a closed workbook, however I'm referencing from the same (open) workbook but from a different worksheet.

    Any help would be appreciated.

    Thanks
    Last edited by benny_gc; 03-26-2017 at 07:12 PM.

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,929

    Re: Countifs referencing data from another worksheet in the same workbook

    Hi, welcome to the forum

    COUNTIFS needs a single column reference, it wont work with an array like that.

    Can you upload a small (clean) sample workbook (not a pic) of what you are working with, and what your expected outcome would look like.
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    03-23-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: Countifs referencing data from another worksheet in the same workbook

    Hi thanks for your reply and welcome

    Unable to attach a sample of the spreadsheet however...

    Leave worksheet has the following:

    Date Day Staff 1 Staff 2 Staff 3
    Mon A B D
    Tue C E
    Wed D E
    Thu B C E
    Fri A D
    Mon C D
    Tue A C E
    Wed D E
    Thu A B E
    Fri C D E

    Analysis worksheet has a table which should reflect the following:

    Staff Mon Tue Wed Thu Fri
    A 1 1 1 1
    B 1 2
    C 1 2 1 1
    D 2 2 2
    E 2 2 2 1

  4. #4
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: Countifs referencing data from another worksheet in the same workbook

    It sounds like you are trying to use the paperclip icon to upload. That hasn't worked for some time.

    To attach a file to your post,
    • click “Go Advanced” (next to Post Quick Reply – bottom right),
    • scroll down until you see “Manage Attachments”, click that,
    • click “Browse”.
    • select your file(s)
    • click “Upload”
    • click “Close window”
    • click “Submit Reply”
    • be sure to desensitize the data
    The file name will appear at the bottom of your reply.
    Dave

  5. #5
    Registered User
    Join Date
    03-23-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: Countifs referencing data from another worksheet in the same workbook

    Thanks

    Have tried at work but still doesn't allow me to upload the spreadsheet.

    Will give it a go a home

    Cheers!

  6. #6
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Countifs referencing data from another worksheet in the same workbook

    I believe that the following formula will do what you want:
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Let us know if you have any questions.
    Attached Files Attached Files
    Consider taking the time to add to the reputation of everybody that has taken the time to respond to your query.

  7. #7
    Registered User
    Join Date
    03-23-2017
    Location
    Melbourne, Australia
    MS-Off Ver
    2010
    Posts
    4

    Re: Countifs referencing data from another worksheet in the same workbook

    Thanks JeteMc. Used your formula with a few tweaks to the reference cells and it works.

    Appreciate the assistance

  8. #8
    Forum Guru
    Join Date
    08-28-2014
    Location
    USA
    MS-Off Ver
    Excel 2019
    Posts
    17,548

    Re: Countifs referencing data from another worksheet in the same workbook

    You're Welcome and thank you for the feedback. Please take a moment to mark the thread as 'Solved' using the thread tools link above your first post. I hope that you have a blessed day.

+ 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. Replies: 42
    Last Post: 06-15-2016, 11:07 AM
  2. Referencing a month in a cell in a different worksheet but same workbook
    By RonH_1972 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 02-03-2016, 11:11 AM
  3. [SOLVED] Referencing cells to open a worksheet from another workbook
    By Ljung in forum Excel - New Users/Basics
    Replies: 3
    Last Post: 01-29-2016, 01:18 AM
  4. Countifs not working when data is on second worksheet.
    By lans4rd in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 09-24-2015, 06:12 PM
  5. Moving worksheet with named ranges to new workbook without referencing old workbook
    By madcaplaughs79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-28-2014, 07:54 PM
  6. [SOLVED] Trouble copying data from closed workbook into active workbook, referencing help
    By lepperga in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2013, 01:48 PM
  7. [SOLVED] different functions in 1 cell while referencing a different worksheet within workbook
    By ladeewzl in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 07-17-2012, 06:53 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