+ Reply to Thread
Results 1 to 3 of 3

Counting cell totals but omitting selected rows

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

    Counting cell totals but omitting selected rows

    Hi everyone

    This may be an easy fix for you Excel gurus but I am fighting a losing fight!

    In the attached spreadsheet example, I tally a number of cell ranges to get totals for gender, location, age range etc.

    However, how can I do the same thing but ask Excel to omit counting these tallies if I have marked them as a duplicate? (Please not none of the names are dupicated in the sheet, the data is just generic to create a smaple sheet). I have marked the duplicates with 'Y' in Column M. Essentially, how can I tally all of the specifics I require (as shown in the sheet - gender, ethnicity etc.) but not count any rows that contain a 'Y' in Column M?

    I hope this makes sense. If not, please ask me and I will clarify any salient points I've missed.

    Thank you for your help
    Attached Files Attached Files
    Last edited by Lemmiwinks; 05-21-2019 at 07:13 AM. Reason: Incorrect term in post title

  2. #2
    Forum Expert
    Join Date
    12-03-2009
    Location
    Florence, Italy
    MS-Off Ver
    Excel 2019
    Posts
    1,796

    Re: Counting cell totals but omitting selected rows

    Hi

    a COUNTIFS should do the trick

    =COUNTIFS(C1:C4926,"Male",M1:M4926,"<>"&"Y")

    You could list in O1:O25 Sunderlands towns in order to modify formula in E15

    =SUMPRODUCT(COUNTIS(L$1:L$4926,O1:O25,M$1:M$4926,"<>"&"Y"))

    Hope it helps
    -----------------------------------------------------

    At Excelforum, you can say "Thank you!" by clicking the star icon ("Add Reputation") below the post.

    Please, mark your thread [SOLVED] if you received your answer.

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

    Re: Counting cell totals but omitting selected rows

    That works perfectly. Thank you so much for your help!!

    Best wishes

+ 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] Overflow error on worksheet_selectionchange when counting selected cells
    By Spritz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2021, 01:05 PM
  2. Button that inserts a text into a selected cell or a range on selected cells
    By gorely84 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-21-2018, 10:47 PM
  3. [SOLVED] Count the cells in a string of cells omitting zeros and specific cells
    By Hawkmoth1 in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 09-23-2017, 08:39 AM
  4. [SOLVED] can not build the macro for counting cells and displaying totals on command.
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2013, 09:53 AM
  5. Replies: 5
    Last Post: 07-26-2012, 08:46 PM
  6. Counting calendar days, omitting holidays
    By Jackal in forum Excel General
    Replies: 5
    Last Post: 05-01-2008, 03:20 PM
  7. Macro to take selected cells times a selected cell
    By Craig in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-23-2005, 08:05 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