CountA for multiple words - need to exclude a few words and 2 need dividing by 2

DumDeeDah

New Member
Joined
Nov 9, 2022
Messages
3
Office Version
  1. 2021
Platform
  1. Windows
Kaya,

We have a Leave planner chart that counts leave for the month.

All leave codes appear from drop down list.

Then those figures are added to a totals page.

Current Sum

=COUNTA(C14:AG14)-((COUNTIF(C14:AG14,"H1")+COUNTIF(C14:AG14,"H2"))/2) - please note H1 & H2 are half days which is why they are divided by 2.

However, we are now adding in a few other leave words (all in the dropdown list) and we do not want to count those in the leave total. WFH, TOIL, NP, PH

I would certainly apprecaite some advice on how to exclude multiple words.

Thanks

Dee
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
Hi & welcome to MrExcel.
How many values are there that should be counted & how many that shouldn't?
 
Upvote 0
Hi & welcome to MrExcel.
How many values are there that should be counted & how many that shouldn't?
There are 13 total. 4 need excluding, 9 need including - plus two of the 9 are only 0.5 (H1 & H2).

Thanks
1668124025299.png
 
Upvote 0
Ok, how about
Excel Formula:
=COUNTIFS(C14:AG14,"<>WFH",C14:AG14,"<>TOIL",C14:AG14,"<>NP",C14:AG14,"<>PH",C14:AG14,"<>")-((COUNTIF(C14:AG14,"H1")+COUNTIF(C14:AG14,"H2"))/2)
 
Upvote 0
=COUNTIFS(C14:AG14,"<>WFH",C14:AG14,"<>TOIL",C14:AG14,"<>NP",C14:AG14,"<>PH",C14:AG14,"<>")-((COUNTIF(C14:AG14,"H1")+COUNTIF(C14:AG14,"H2"))/2)
Thanks but it is not totalling anything. Gave a Nil answer.

No error message so it must be close.
 
Upvote 0
In that case can you post some sample data showing the problem.

MrExcel has a tool called “XL2BB” that lets you post samples of your data that will allow us to copy/paste it to our Excel spreadsheets, so we can work with the same copy of data that you are. Instructions on using this tool can be found here: XL2BB Add-in

Note that there is also a "Test Here” forum on this board. This is a place where you can test using this tool (or any other posting techniques that you want to test) before trying to use those tools in your actual posts.
 
Upvote 0

Forum statistics

Threads
1,224,817
Messages
6,181,149
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top