count if doubling results

Linsie

New Member
Joined
Jul 19, 2012
Messages
27
Office Version
  1. 2021
Platform
  1. Windows
Hi,

It may be the time of night, but i can't for the life of me figure out how to stop my formula from doubling some results.

The formula i am using is
=COUNTIF(W251:W273,"*O*")+COUNTIF(W251:W273,"*+*")

The formula is to count how many overtime shifts are being worked that day.

The cell will be contents can be
M+
A+
N+
MO+
AO+
NO+

All of these entries should only be counted once. However the cells that has the O and the + in them are being counted twice.

Can anyone please save my very tired brain and suggest how to resolve it?

Thanks in advance.
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
=countif(w251:w273,"*o*")+countif(w251:w273,"*+*")-countif(w251:w273, "*o*+*")-countif(w251:w273, "*+*o*")
 
Last edited:
Upvote 0
I may be missing something, but it seems that everything your counting depends on it having a +, whether or not there is an O with it, so couldn't you just count for that?

=COUNTIF(W251:W256,"*+*")
 
Upvote 0
You know Scott, I have looked at this report for the last 8 hours working on it and setting it up, and i didn't even realize that. Thank you for pointing it out. Problem now solved!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,655
Messages
6,120,760
Members
448,991
Latest member
Hanakoro

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