+ Reply to Thread
Results 1 to 10 of 10

If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

  1. #1
    Registered User
    Join Date
    07-07-2021
    Location
    australia
    MS-Off Ver
    Office 365
    Posts
    40

    If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    Hi all

    I need help with this formula.

    If cells D15:D100 contain the product name "TEFLON" THEN count all the cells that contain the letter "A" in cells J15:U1500 and return that number.

    Some assistance would be awesome.

    THank you

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,890

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    Fast answers need visual help. Please read the yellow banner at the top of this page on how to attach a file.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert Sam Capricci's Avatar
    Join Date
    06-14-2012
    Location
    Palm Harbor, Florida
    MS-Off Ver
    16.84 for Mac MS 365
    Posts
    8,499

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    while you are mocking up a workbook, you might want to address the following:
    1) is "teflon" alone in a cell in column D or can it be part of a longer description like red teflon pan?
    2) same question for the letter A, does it appear alone in a cell and that is what you want to count in the range of from columns J through U?
    3) lastly, most often the way sumifs and countifs work is by counting across the SAME row, so that if D17 has teflon and K17 has A you would count it but what would be the criteria to count a row P200 that contains an A when your range for counting "teflon" ends at row 100? Usually the ranges have to be the same or the formula will not work.
    Make contributors happy, click on the "* Add Reputation" as a way to say thank you.
    Sam Capricci

  4. #4
    Registered User
    Join Date
    07-07-2021
    Location
    australia
    MS-Off Ver
    Office 365
    Posts
    40

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    I have attached a copy of the excel document.

    so I need a formula for the red highlighted cells in the top table in the spreadsheet. I need it so that it updates the PRODUCT TOTALS under the headings "ACTIVE", "DEAD", "LOST" & "CONVERTED" WHEN A CODE (BEING "a" - ACTIVE, "d" - DEAD, "l" - LOST & "c" - CONVERTED is entered in the "2020" calendar section, based on what product is chosen in column D (PRODUCT). Does that make sense? sorry I am hopeless at explaining things!
    Attached Files Attached Files

  5. #5
    Forum Expert Pepe Le Mokko's Avatar
    Join Date
    05-14-2009
    Location
    Belgium
    MS-Off Ver
    O365 v 2402
    Posts
    13,448

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    Hi
    as answers are tailored to the XL version, please add your correct XL version to your profile. Thanks

  6. #6
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    Remove the trailing space from H1, then in E2 copied across and down:

    =SUMPRODUCT(($D16:$D21=D2)*($J$16:$U$21=MID(RIGHT(E$1,3),2,1)))

    Administrative Note:

    Members will tailor the solutions they offer to the version of Office (Excel) that you have. Please check that your forum profile is up-to-date in this respect. If you aren't sure, in Excel go to File | Account and report what it says below the MS logo at the top of that page. If your version is for Mac, please also state this. Thanks.
    Attached Files Attached Files
    Last edited by AliGW; 01-06-2022 at 03:20 AM.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  7. #7
    Forum Moderator Glenn Kennedy's Avatar
    Join Date
    07-08-2012
    Location
    Digital Nomad... occasionally based in Ireland.
    MS-Off Ver
    O365 (PC) V 2403
    Posts
    44,055

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    That doesn't work. The $ are missing and it doesn't count the cs.

    So change the headers to ACTIVE ( a ) ... with a space either side of the code letter... to prevent Excel changing (c) to the copyright symbol.

    Delete the training space in H1, as mentioned.

    Delete the value in D6, TEFLON-PTFE. It's aready there in row 2.

    Then use this, with the $ signs correctly assigned:

    =SUMPRODUCT(($D$16:$D$21=$D2)*($J$16:$U$21=MID(RIGHT(E$1,4),2,1)))

    It gives a total of 16 (the correct answer). If you want to remove the zeros, which can be a bit distracting, modify to:

    =IFERROR(1/(1/SUMPRODUCT(($D$16:$D$21=$D2)*($J$16:$U$21=MID(RIGHT(E$1,4),2,1)))),"")
    Attached Files Attached Files
    Last edited by Glenn Kennedy; 01-06-2022 at 05:03 AM.
    Glenn




    None of us get paid for helping you... we do this for fun. So DON'T FORGET to say "Thank You" to all who have freely given some of their time to help YOU.

    Temporary addition of accented to illustrate ongoing problem to the TT: L? fh?ile P?draig sona dhaoibh

  8. #8
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    That doesn't work. The $ are missing and it doesn't count the cs.
    Good spot.

  9. #9
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,209

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    Works fine without adding the spaces i,e "(c)" but with correct absolute addressing.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  10. #10
    Forum Expert
    Join Date
    09-30-2019
    Location
    Chiangmai, Thailand
    MS-Off Ver
    Office 2016, Excel 2019
    Posts
    1,234

    Re: If Cell Contains "PRODUCT NAME" then count all the cells that contain the letter "a"

    Please try,

    change D2 to POLYETHYLENE

    Formula in E2
    =SUM(IF(($D$14:$D$86=$D2),--($J$14:$U$86=LOWER(LEFT(E$1,1)))))

    Follow with Ctrl-Shift-Enter for array formula.

    Regards.

+ 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: 5
    Last Post: 02-05-2019, 12:03 AM
  2. [SOLVED] Column X-Ref list - Sheet1 Col A "pages", Col B:FL "Req" to Sheet2 ColA "req", ColB "page"
    By excel-card-pulled in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 04-07-2017, 09:30 AM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Replies: 0
    Last Post: 01-09-2013, 06:52 PM
  5. [SOLVED] Data validation: allow entry into a cell if other three cells have "X", "Y" and "Z"?
    By RogerRangeRover in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-05-2013, 04:49 AM
  6. [SOLVED] How to Count number of "Error" and "OK" after the word "Instrument" found in table row
    By eltonlaw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-17-2012, 06:26 AM
  7. Replies: 7
    Last Post: 05-13-2006, 05:02 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