# Sum a row where cells contain text and numbers

#### dbarnes

##### New Member
I am trying to "sum" a row with the following data

A1 has 20gb
B1 has 23gb
C1 is blank
D1 is blank
E1 is the sum of the entire row

in the "E1" Cell I have the following formula to calculate /w text the sum for the row
=SUM(VALUE(LEFT(C4:M4,LEN(C4:M4)-2)))

This works fine if I do not have any blank cells in my row; however, if there are blank cells, I get a "#VALUE!" in cell E1.

How can I calculate a row where the cells contain a mix of numbers and text as well as some cells being blank?

Thanks!

### Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

##### MrExcel MVP
=SUMPRODUCT((0&SUBSTITUTE(UPPER(C4:M4),"GB",""))+0)

#### barry houdini

##### MrExcel MVP

If so perhaps you can just format the cells as

0"gb" and then put 20 in A1, 23 in B1 and just use

=SUM(A1:D1)

#### meytithveasna

##### Board Regular
=SUMPRODUCT(--TRIM(SUBSTITUTE(A1:D1,"gb","")))

Replies
3
Views
99
Replies
6
Views
74
Replies
6
Views
106
Replies
2
Views
37
Replies
10
Views
208

1,136,989
Messages
5,678,975
Members
419,796
Latest member
doctorgresham

### 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.

### Which adblocker are you using?

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

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