# Text in a calculation

#### ExcelRoy

##### Well-known Member
Hi,

is there a way to ignore text in a formula

=IF(F22="","",SUM(G22-H22))

G22 on this formula is set to "Not Set" as there is no number to calculate

Could the calculation be "tricked" into thinking it actually is a 0 and therefore calculate as required?

Many Thanks

### Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.
=IF(F22="","",SUM(G22:H22)) change the- to : and see if you still get an error

So if G22 is "Not Set"
You would want G22 to be treated as Zero, therefor 0-H22
So if H22 was say 10, you'd get -10

Is that what you want?

Could there be text in either cell, G22 or H22 ?
Should the same effect occur for both cells?

sorry I thought it was a range are you trying to subtract one cell from the other.

No worries Drrellik,

Yes Jonmo spot on

Only text may be in G22 never in H22

Thanks

Try

=IF(F22="","",SUM(G22)-H22)

That's perfect,

Thanks Jonmo

I am trying to build a weekly time sheet with in and out times, as well as "vacation" and "off" text in the cells, but when I sum everything up, I get a value error. Is there a way to use a function in addition to the sum function to tell excel the text is either zero or a number?

JDubbs,

you might want to start a new thread rather than post here, on an older thread that has nothing to do with what you are asking about. it wont get seen by the whole forum. and I am sorry I can't move it for you.

Replies
9
Views
121
Replies
0
Views
365
Replies
6
Views
100
Replies
9
Views
362
Replies
3
Views
183

1,216,299
Messages
6,129,969
Members
449,545
Latest member
SURY

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