View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
T. Valko T. Valko is offline
external usenet poster
 
Posts: 15,768
Default Some cells contain # and text, some # only - want to sum # (number

Assuming that every cell that contains "*" also contains a number...

Try this array formula** :

=SUM(IF(RIGHT(A1:A10)="*",--LEFT(A1:A10,LEN(A1:A10)-1)),A1:A10)

** array formulas need to be entered using the key combination of
CTRL,SHIFT,ENTER (not just ENTER). Hold down both the CTRL key and the SHIFT
key then hit ENTER.

--
Biff
Microsoft Excel MVP


"NCCADM" wrote in message
...
Say cell A1 contains 1*, and A2 contains 1, when I do sum(A1:A2) I get 1
as
the answer (obviously).

I would like to be able to include the numerical part of the entries in
these cells and ignore the text part. I know that I can format cell A1
like
this: # "*", but to apply a special format to each cell that includes the
*
is a clumsy approach I think.

Is there any way to format all the cells so that the *'s are ignored,
without writing a macro?

Thanks for your time.