Formula to add/subtract text characters in a row.

aacod

Well-known Member
Joined
Mar 20, 2009
Messages
667
In row D28:AH28 in majority of the cells, I have X, L, TW, H and PV. Few cells do not have anything, just blank.

I need a formula to add cells which contain X, TW and subtract from that total cells containing L, H, PV and blank cells.

Thanks.

aacod.
 

Some videos you may like

Excel Facts

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.

JoeMo

MrExcel MVP
Joined
May 26, 2009
Messages
17,389
Office Version
  1. 365
  2. 2010
Platform
  1. Windows
Code:
=countif(d28:ah28,"x")+countif(d28:ah28,"tw")-countif(d28:ah28,"l")-countif(d28:ah28,"h")-countif(d28:ah28,"pv")-countif(d28:ah28,"")
 

aacod

Well-known Member
Joined
Mar 20, 2009
Messages
667
JoeMo,

The formula works perfect for the above description, but sorry for not describing perfectly what I wanted to accomplish.

I am trying to count a total of 'X' and 'TW', 'C, and 'CWS' from 30 to 31 cells each representing the day of the month and not count the 'L', 'H', 'PV' 'W' and blank cell(s).

Please see example below:

xxTW
xLWWxxTW
xLWWxxTW
xLWWxxTW
xLWWxx =18

<colgroup><col span="18" width="22"><col span="13" width="22"><col width="54"></colgroup><tbody>
</tbody>


Thanks.

aacod
 

Watch MrExcel Video

Forum statistics

Threads
1,123,142
Messages
5,599,971
Members
414,353
Latest member
ljhan

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
Top