Welcome to the Excel Forum

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 07-02-2009, 07:01 AM
steviegee steviegee is offline
Registered User
 
Join Date: 28 Jun 2007
Posts: 31
steviegee is becoming part of the community
Text and numbers

Please Register to Remove these Ads

Hi all,

i wish to add the sum of 2 coulmns, however on some occasions some cells may contain text, in some instances both cells may contain text, is there a formula to get around this problem.


thanks
steviegee
Reply With Quote
  #2  
Old 07-02-2009, 07:19 AM
martindwilson's Avatar
martindwilson martindwilson is online now
Forum Guru
 
Join Date: 23 Jun 2007
Location: London,England
MS Office Version:office 97 ,2003 ,2007
Posts: 6,063
martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding martindwilson Has a higher level of understanding
Re: Text and numbers

Try
=if(and(istext(a1),istext(b1)),0,if(istext(a1),b1,if(istext(b1),a1,a1+b1)))
__________________
Mojito connoisseur and a dabbler in Cisco
where does code go ?
look here
how to insert code

how to enter array formula


recommended reading
wiki Mojito

how to say no convincingly

most important think you need
Reply With Quote
  #3  
Old 07-02-2009, 08:02 AM
steviegee steviegee is offline
Registered User
 
Join Date: 28 Jun 2007
Posts: 31
steviegee is becoming part of the community
Re: Text and numbers

Genius,


Many thanks,
thats solved the situation nicely.


Thanks for the tips, and i will read them.

regards
steviegee
Reply With Quote
  #4  
Old 07-02-2009, 08:13 AM
DonkeyOte's Avatar
DonkeyOte DonkeyOte is offline
Forum Guru
 
Join Date: 22 Oct 2008
Location: Suffolk, UK
MS Office Version:2002 & 2007
Posts: 13,639
DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute
Re: Text and numbers

Why not just use SUM ?

=SUM(A1:B1)

Non-numerics are simply ignored and the ranges need not be contiguous, ie:

=SUM(A1:B1,D1,Z10:AA12,AD1)
Reply With Quote
  #5  
Old 07-02-2009, 10:16 AM
steviegee steviegee is offline
Registered User
 
Join Date: 28 Jun 2007
Posts: 31
steviegee is becoming part of the community
Re: Text and numbers

Both formulas do the job,

however how can i get rid of the "false" errors if there is no values or text in the cells?


Thanks
Reply With Quote
  #6  
Old 07-02-2009, 10:17 AM
DonkeyOte's Avatar
DonkeyOte DonkeyOte is offline
Forum Guru
 
Join Date: 22 Oct 2008
Location: Suffolk, UK
MS Office Version:2002 & 2007
Posts: 13,639
DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute
Re: Text and numbers

Use SUM - it will simply return 0.
Reply With Quote
  #7  
Old 07-02-2009, 10:26 AM
steviegee steviegee is offline
Registered User
 
Join Date: 28 Jun 2007
Posts: 31
steviegee is becoming part of the community
Re: Text and numbers

I understand what your saying, but i do need the cells that have no values or text to return a blank anwser,they a1&b1 will have no text or values, it will not just be 1 cell that has a value or text.

basically it will be a block of data, then scroll down to find the next block of data.

hope your understanding me.


steviegee
Reply With Quote
  #8  
Old 07-02-2009, 10:30 AM
DonkeyOte's Avatar
DonkeyOte DonkeyOte is offline
Forum Guru
 
Join Date: 22 Oct 2008
Location: Suffolk, UK
MS Office Version:2002 & 2007
Posts: 13,639
DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute
Re: Text and numbers

No, I'm afraid I don't follow...

If you want a Null

=IF(COUNT(A1:B1),SUM(A1:B1),"")

Alternatively if the SUM of A1:B1 will never genuinely be 0 then you can use SUM as before but apply a Custom Format on the cells containing the formulae of: General;;
As such 0's display as Blanks.
Reply With Quote
  #9  
Old 07-02-2009, 10:34 AM
steviegee steviegee is offline
Registered User
 
Join Date: 28 Jun 2007
Posts: 31
steviegee is becoming part of the community
Re: Text and numbers

Problem solved.


Perfect.



Many thanks


Steviegee
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump