We’d like to remind Forumites to please avoid political debate on the Forum.

This is to keep it a safe and useful space for MoneySaving discussions. Threads that are – or become – political in nature may be removed in line with the Forum’s rules. Thank you for your understanding.

📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
The Forum now has a brand new text editor, adding a bunch of handy features to use when creating posts. Read more in our how-to guide

Help please with COUNTIF

Hello. I'm trying to count the number of cells that contain the word 'Yes' but the formula I'm using (=countif(A1:A10, "Yes") only seems to recognise cells where 'Yes' is the only word. Is there a way around it? Some of my cells state (Yes but...) or (Yes, subject to) and I would like those cells to be included in the count.

Many thanks if there's anyone out there who can help.

The reason people don't move right down inside the carriage is that there's nothing to hold onto when you're in the middle.

Comments

  • forgotmyname
    forgotmyname Posts: 33,013 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    Add an asterisk before / after the word as required.  It will then pickup   "Maybe Yes"  or   "Yes Maybe"  etc.

    Censorship Reigns Supreme in Troll City...

  • Milky_Mocha
    Milky_Mocha Posts: 1,066 Forumite
    Part of the Furniture 500 Posts Name Dropper Combo Breaker

    You're a star, forgotmyname. That worked! Thank you so much. You've saved me several minutes of youtube video trawling, some of which I had already done to no avail. This stuff should be taught in schools - to all kids, not just computer science takers!

    Thanks again.

    The reason people don't move right down inside the carriage is that there's nothing to hold onto when you're in the middle.
  • debitcardmayhem
    debitcardmayhem Posts: 13,415 Forumite
    Part of the Furniture 10,000 Posts Name Dropper Photogenic
    edited 17 December 2021 at 6:22PM
    aah but does it also count Eyes or Byes ?? B) or yesterdays
    4.8kWp 12x400W Longhi 9.6 kWh battery Giv-hy 5.0 Inverter, WSW facing Essex . Aint no sunshine ☀️ Octopus gas fixed dec 24 @ 5.74 tracker again+ Octopus Intelligent Flux leccy

    CEC Email energyclub@moneysavingexpert.com
  • Milky_Mocha
    Milky_Mocha Posts: 1,066 Forumite
    Part of the Furniture 500 Posts Name Dropper Combo Breaker
    hahaha, debitcardmayhem don't start LOL! Good question, though and I'll bear that in mind for future uses of the formulae. For my current purposes, that won't be an issue because the cells that my formula is scanning only contain specific drop-down options with no eyes, byes or other :-D
    The reason people don't move right down inside the carriage is that there's nothing to hold onto when you're in the middle.
  • But you can easy overcome with the test content contained within an OR function on the lines of Or("yes *", "* yes", "* yes *") etc but include forms where there may be, for example, yes followed by commas or stops or others. Often easily covered by a range of ASCII values.

    Be aware that in some circumstances a cell with a drop down list can have entry typed in and thus not confirm to the list!
  • jamesd
    jamesd Posts: 26,103 Forumite
    Part of the Furniture 10,000 Posts Name Dropper
    Sometimes it's useful to use left and right functions to chop out all but the bit that's of interest.
Meet your Ambassadors

🚀 Getting Started

Hi new member!

Our Getting Started Guide will help you get the most out of the Forum

Categories

  • All Categories
  • 353.5K Banking & Borrowing
  • 254.1K Reduce Debt & Boost Income
  • 455K Spending & Discounts
  • 246.6K Work, Benefits & Business
  • 602.9K Mortgages, Homes & Bills
  • 178.1K Life & Family
  • 260.6K Travel & Transport
  • 1.5M Hobbies & Leisure
  • 16K Discuss & Feedback
  • 37.7K Read-Only Boards

Is this how you want to be seen?

We see you are using a default avatar. It takes only a few seconds to pick a picture.