Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default If cell contains text, leave as is

Trying to create a formula that will sum 5 cells to the right of the
cell in question if the cell the cell in question contains a Numerical
value, and that will do nothing if the cell in question contains text.

I have gotten as far as:

IF(TYPE(1), SUM(C6513:M6513), "")

Obviously, "" does not return the same text originally in the cell, but
instead a 0.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default If cell contains text, leave as is

the cell in question has to contain a value or a formula (or be blank). If
it contains a formula, then it is unclear where you are testing.

Instead of saying Cell in question, say

if A1 contains text then in cell B6513 display "" else display
SUM(C6513:M6513),

=if(istext(A1),"",SUM(C6513:M6513))

as an example.

--
Regards,
Tom Ogilvy



" wrote:

Trying to create a formula that will sum 5 cells to the right of the
cell in question if the cell the cell in question contains a Numerical
value, and that will do nothing if the cell in question contains text.

I have gotten as far as:

IF(TYPE(1), SUM(C6513:M6513), "")

Obviously, "" does not return the same text originally in the cell, but
instead a 0.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default If cell contains text, leave as is

Ok, let me reword

This is what I have:

=IF(N7279=TYPE(1),SUM(C7279:M7279), N7279)

In cell O7279

There are two more adjustments needed. If cell N7279 is blank(no value
or formula) then O7279 should be blank. Also is there a way to copy
the formatting from cell N7279 to O7279 in the same formula?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default If cell contains text, leave as is

=type(1)

always returns 1 since the argument you provided (1) is a number


=If(N7279="","",IF(type(N7279)=2,"",If(type(N7279) =1,SUM(C7279:M7279),"")))

--
Regards,
Tom Ogilvy


" wrote:

Ok, let me reword

This is what I have:

=IF(N7279=TYPE(1),SUM(C7279:M7279), N7279)

In cell O7279

There are two more adjustments needed. If cell N7279 is blank(no value
or formula) then O7279 should be blank. Also is there a way to copy
the formatting from cell N7279 to O7279 in the same formula?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
text box that will leave only the last 4 digits entered cj2k2k Excel Discussion (Misc queries) 0 June 13th 07 01:06 PM
if=0 then n/a if<0 leave the value in the cell Hoofnagle Excel Worksheet Functions 2 October 5th 06 02:46 AM
How do I leave formula cell blank if 2nd reference cell is empty? Liana S Excel Discussion (Misc queries) 2 October 21st 05 04:38 PM
How to compose a Leave Table in text & color bar? feliling Excel Programming 4 June 2nd 05 06:38 PM
Can you sort text in a column, but leave cell color alone? g wills New Users to Excel 4 December 3rd 04 10:42 AM


All times are GMT +1. The time now is 04:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"