Text in a calculation

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows
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
 

Some videos you may like

Excel Facts

Repeat Last Command
Pressing F4 adds dollar signs when editing a formula. When not editing, F4 repeats last command.

Drrellik

Well-known Member
Joined
Apr 29, 2013
Messages
770
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2011
  5. 2010
Platform
  1. Windows
=IF(F22="","",SUM(G22:H22)) change the- to : and see if you still get an error
 

Jonmo1

MrExcel MVP
Joined
Oct 12, 2006
Messages
44,061
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?
 

Drrellik

Well-known Member
Joined
Apr 29, 2013
Messages
770
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2011
  5. 2010
Platform
  1. Windows
sorry I thought it was a range are you trying to subtract one cell from the other.
 

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows

ADVERTISEMENT

No worries Drrellik,

Yes Jonmo spot on

Only text may be in G22 never in H22

Thanks
 

ExcelRoy

Well-known Member
Joined
Oct 2, 2006
Messages
2,450
Office Version
  1. 2007
Platform
  1. Windows

ADVERTISEMENT

That's perfect,

Thanks Jonmo
 

jdubbs41

New Member
Joined
Jul 2, 2015
Messages
8
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?
 

Drrellik

Well-known Member
Joined
Apr 29, 2013
Messages
770
Office Version
  1. 365
  2. 2016
  3. 2013
  4. 2011
  5. 2010
Platform
  1. Windows
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,281
Messages
5,600,720
Members
414,401
Latest member
grenona2020

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