+ Reply to Thread
Results 1 to 10 of 10

Using COUNTIF across multiple worksheets to cross-reference age & location

  1. #1
    Registered User
    Join Date
    06-27-2014
    Location
    South Tyneside
    MS-Off Ver
    2013
    Posts
    23

    Using COUNTIF across multiple worksheets to cross-reference age & location

    Hi everyone

    With previous help from this forum I've almost got my Excel sheet where I want it. However, I've still got one last hurdle to overcome and it is outside of my realms of Excel knowledge!

    I have attached a dummy version of my spreadsheet to show what I am doing.

    I would like to count how many people from each specified age range come from specific 'wards'. This would be a combined total across all active worksheets (as listed in Wards Info sheet, column A). Example, there were 4 people aged 35-44 from Primrose ward. Is it possible for Excel to do this kind of dual lookup and count? This info would be collated on 'Wards Info' sheet next to the overall ward count data already collated.

    All help will be truly appreciated as always.

    Many thanks in advance
    Last edited by Lemmiwinks; 03-31-2019 at 08:16 AM.

  2. #2
    Registered User
    Join Date
    03-19-2019
    Location
    London
    MS-Off Ver
    2003-2016/2016 Mac
    Posts
    57

    Re: Using COUNTIF across multiple worksheets to cross-reference age & location

    Your Workbook doesnt seem to be in order. Can you be more specific.

  3. #3
    Registered User
    Join Date
    06-27-2014
    Location
    South Tyneside
    MS-Off Ver
    2013
    Posts
    23

    Re: Using COUNTIF across multiple worksheets to cross-reference age & location

    Hi

    I'm unsure what you mean by being in order? There is only presently one worksheet 'Traditional Calligraphy' that has any specific data. I will populate the other sheets as and when the data becomes known.

    Using the data in 'Traditional Calligraphy' as a guide, I can see there are two people who are aged in the 65+ age bracket and from 'West Park' ward. What I am looking to achieve within the sheet 'Ward Info' in columns H-O is that tally looking at the age bracket and ward across all sheets as listed in 'Ward Info' Column A.

    Hope this helps.

    I have tweaked the spreadsheet I had originally uploaded, so please use the version attached to this post please.

    Cheers for your help.

  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: Using COUNTIF across multiple worksheets to cross-reference age & location

    Using the data in 'Traditional Calligraphy' as a guide,
    I find no 'Traditional Calligraphy' in the latest upload.

    What I am looking to achieve within the sheet 'Ward Info' in columns H-O is that tally looking at the age bracket and ward across all sheets as listed in 'Ward Info' Column A.
    I also find no sheet 'Ward Info'

    Can you help us out?
    Last edited by FlameRetired; 03-31-2019 at 09:48 PM.
    Dave

  5. #5
    Registered User
    Join Date
    06-27-2014
    Location
    South Tyneside
    MS-Off Ver
    2013
    Posts
    23

    Re: Using COUNTIF across multiple worksheets to cross-reference age & location

    Hi

    It appears I'm having an absolute nightmare. I uploaded the wrong file. So sorry. I shall take myself outside and give myself a good shoeing.

    The correct file is attached to this post.

    Cheers.
    Attached Files Attached Files
    Last edited by Lemmiwinks; 04-01-2019 at 04:49 AM.

  6. #6
    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: Using COUNTIF across multiple worksheets to cross-reference age & location

    I am getting lost and confused.

    The instructions are not clear at all (at least not to me). I can not reconcile the instructions with the data and there is data (scant) in only some of the 18 sheets. The rest are empty. We need data to confirm our formulas are working properly.

    Text "counts" embedded in text strings:
    Example, there were 4 people aged 35-44 from Primrose ward.
    • Please indicate how you arrived at this figure ... and please cite specific sheet(s) and cell(s).
    • I find only one reference to Primrose ward (with an age range 65+) that has a 4 embedded in text () in 'Traditional Calligraphy' J12:M12. I would strongly recommend replacing those embedded "counts" with actual numbers only.

    =SUMPRODUCT(COUNTIFS(INDIRECT("'"&SUBSTITUTE($A$1:$A$14,"'","'")&"'!$M:$M"),SUBSTITUTE(B1,"&","and")))

    This suggests complications in the source and reference data (not accounted for yet?). This would best be taken care of with aggressive source and reference data cleanup rather than trying to reconcile the variations in formula.

    This info would be collated on 'Wards Info' sheet next to the overall ward count data already collated.
    This is not clear. There are two columns of counts.

    Until these things are reconciled (and there may be more) I don't see anything I can work with here.

    Sorry

  7. #7
    Registered User
    Join Date
    06-27-2014
    Location
    South Tyneside
    MS-Off Ver
    2013
    Posts
    23

    Re: Using COUNTIF across multiple worksheets to cross-reference age & location

    Hi FlameRetired

    The data that is being collected is ongoing hence the initial scant data. In the latest upload attached to this post, there is data in two more worksheets. Hopefully, this will help.

    Text "counts" embedded in text strings:
    Example, there were 4 people aged 35-44 from Primrose ward.
    Please indicate how you arrived at this figure ... and please cite specific sheet(s) and cell(s).
    Sorry for the confusion here. I was merely giving an example as a guide. This was not based on specific data but just a method of trying to clarify what I was looking to calculate.

    To be more explicit, on the 'Traditional Calligraphy' sheet, a good example of what I am trying to achieve would be:

    2 people from 'West Park' ward in the age bracket '65+' - adding this total to the 'Ward Info' sheet as a running tally across all 14 worksheets as specified in Column A in the 'Ward Info' sheet.

    The 'substitute' aspect is just to catch anything with 'and' or '&'. This was advised by another member on this forum.

    As regards two columns of counts in the /Ward Info' worksheet, Column B and Column E are essentially the same count. I have split the wards in to two columns to represent two different geographical locations - Column B are wards in one area, Column E are wards in another area. To simplify the process, just focus on Column B wards if that helps. It is also the Column B wards that have been duplicated on the 'Ward Info'sheet with the age brackets above them. This is where I would like to collect the data from the previously specified worksheets (Column A in 'Ward Info') to show how many people from each ward in the different age brackets as a running total.

    Hopefully this helps to clarify the requirements and provides enough data to create a working formula.

    Many thanks and best wishes.
    Attached Files Attached Files
    Last edited by Lemmiwinks; 04-02-2019 at 04:37 AM. Reason: Amendment to Spreadsheet

  8. #8
    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: Using COUNTIF across multiple worksheets to cross-reference age & location

    If I understand correctly you want output in 'Ward Info' I2:O19.

    I took the liberty of changing the whole column references to 1000 rows. Increase that as needed. Normally the IF(s) family of functions permits whole column references with little noticeable affect on performance. Since you are wrapping SUMPRODUCT around that everything changes. SUMPRODUCT has to calculate over one million rows ... across multiple sheets. It was really slow before changing the ranges.

    Please find in the attached.
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  9. #9
    Registered User
    Join Date
    06-27-2014
    Location
    South Tyneside
    MS-Off Ver
    2013
    Posts
    23

    Re: Using COUNTIF across multiple worksheets to cross-reference age & location

    Hi FlameRetired

    You are indeed a star! That is exactly what I wanted to achieve.

    Thank you so much for your patience and support. It is very much appreciated.

    All the best

  10. #10
    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: Using COUNTIF across multiple worksheets to cross-reference age & location

    You are welcome. Glad to help.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. Thanks.

+ 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. [SOLVED] Cross-Reference Multiple Criteria for a Returned Value
    By kibbles in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 08-11-2016, 06:18 PM
  2. Search engine for cross-reference in multiple worksheets
    By dannyjoer in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-10-2013, 05:09 PM
  3. [SOLVED] Cross Reference Multiple Fields for Answer
    By IN_FOR_SIN in forum Excel General
    Replies: 2
    Last Post: 08-16-2013, 09:11 AM
  4. [SOLVED] Cross reference with multiple instances in reference data
    By Nick F in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-08-2013, 10:31 AM
  5. Cross Reference with multiple values
    By Hex1 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-28-2013, 09:40 PM
  6. need help, cross reference, multiple vlookups
    By alexanderdeluna in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 08-23-2012, 02:57 PM
  7. Cross Reference multiple columns and copy
    By bsmith127 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-16-2009, 12:51 PM

Tags for this Thread

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