How do I add range of cells with text and numbers but only include cells with certain text?

linnk

New Member
Joined
Jul 27, 2015
Messages
4
[TABLE="class: grid, width: 160"]
<colgroup><col width="80" span="2" style="width:60pt"> </colgroup><tbody>[TR]
[TD="width: 80"]A[/TD]
[TD="width: 80"]B[/TD]
[/TR]
[TR]
[TD]NA[/TD]
[TD]NA[/TD]
[/TR]
[TR]
[TD]4.6 U[/TD]
[TD]23 U[/TD]
[/TR]
[TR]
[TD]1.5 U[/TD]
[TD]7.5 U[/TD]
[/TR]
[TR]
[TD]4.7 U[/TD]
[TD]24 U[/TD]
[/TR]
[TR]
[TD]52[/TD]
[TD]52[/TD]
[/TR]
[TR]
[TD]280[/TD]
[TD]400[/TD]
[/TR]
[TR]
[TD]84 U[/TD]
[TD]420 UJ[/TD]
[/TR]
[TR]
[TD]NA[/TD]
[TD]NA[/TD]
[/TR]
[TR]
[TD]25 UJ[/TD]
[TD]120 UJ[/TD]
[/TR]
[TR]
[TD]NA[/TD]
[TD]NA[/TD]
[/TR]
[TR]
[TD]3,400 D[/TD]
[TD]3,300 J[/TD]
[/TR]
[TR]
[TD]25 U[/TD]
[TD]120 U[/TD]
[/TR]
[TR]
[TD]5 U[/TD]
[TD]25 U[/TD]
[/TR]
[TR]
[TD]26 U[/TD]
[TD]0.5 U[/TD]
[/TR]
[TR]
[TD]22 U[/TD]
[TD]0.51 U[/TD]
[/TR]
</tbody>[/TABLE]

Above are two scenarios (column A and B). I have a formula that will ignore all text, but what formula will sum the individual columns including only cells containing the letter "U" (U, UJ, UJB etc.)? The array formulas (ctrl+shft+enter) I've been using return #value if the number of digits in a cell change from one column to the next. A formula for a fixed number of digits will not work because the number of digits vary from one column to the next.

for example:
=SUM(IF((RIGHT(B1:B15,1))="U",(--LEFT((IF(B1:B15="",0,B1:B15)),3)),0)) works for Column B but not for Column A and only finds "U". I need it to find any text that includes "U" and work with a variance of number lengths rather than the left 3 digits.

Thanks in advance for your help.
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Hello,

=SUM(IF(NOT(ISERROR(FIND("U",A1:A15))),(--LEFT(IF(A1:A15="",0,A1:A15),FIND(" ",A1:A15)))))

this gives 197.8 for Col A and 740.51 for Col B. Are these correct?

This is an array formula, so CTRL + SHIFT + ENTER required.
 
Upvote 0

Forum statistics

Threads
1,222,827
Messages
6,168,482
Members
452,192
Latest member
FengXue

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