Hey r/googlesheets, long time listener, first time caller, here with kind of a dumb question.
I'm making a guest list. First name is column A, last name is column B, "Plus one?" is column C, with a dropdown menu. What function would I use to count all the cells in column A that have text in them. Ultimately, I want a cell with the total number of guests.
Thanks in advance.
Counta should do the trick
Posting your data can make it easier for others to help you, but it looks like your submission doesn't include any. If this is the case and data would help, you can read how to include it in the submission guide. You can also use this tool created by a Reddit community member to create a blank Google Sheets document that isn't connected to your account. Thank you.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
You could try:

Formula in E2:
=ARRAYFORMULA(COUNTIF(TRIM(REGEXREPLACE(SPLIT(TEXTJOIN("+",TRUE,B$2:B$20),"+"),"(?:Purple|Blue|Pink|Green)","")),D2))
Note that I altered the D-columns values a bit so they would actually match those values in B-column.
The very nice formula in the answer given by JvdV, needs to be dragged down for the rest of the list.
Expanding the formula
You could further expand by trying the following in cell G1
=QUERY(TRANSPOSE(INDEX(TRIM(REGEXREPLACE(SPLIT(TEXTJOIN("+",TRUE,B:B),"+"),"(?:Purple|Blue|Pink|Green)","")))),
"select Col1, count(Col1) where Col1<>''
group by Col1 label count(Col1) 'QTY' ",1)

PROS
- A single self-expanding formula for all present and all future products
- All products become alphabetised
- There is no need for the extra column
Dwhere to manually write all products. This way you avoid human errors.
CONS
- The fact that all products are accounted for will be a problem if you want just some of them -like just the notebooks-