SUM NUMBERS WITH APPENDING TEXT

G

Guest

I have a problem on hoe to deal with this data:
in a column data are as follows:
5N
4N
3
4
3N and so on
Now i'd like to sum up all numbers with appending text, and counting cells
having "N",and count cells without "N". I hope somebody can urgently help
me..thanks
 
G

Guest

Hi,

Try something like these 2 array formulas:


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

and for counting n's use:

=SUM(IF(RIGHT(A1:A10,1)="n",1))

both formula will need to be entered using CTRL+SHIFT+ENTER

Hope this helps!
Jean-Guy
 
S

Sandy Mann

If there is only ever only one letter N in the cells then to add up those
cells try:

=SUM(IF(RIGHT(A1:A4)="N",--LEFT(A1:A4,LEN(A1:A4)-1)))

This is an array formula which must be entered with Control and Shift
pressed and held while you press Enter

To add up the other cells then simply =SUM(A1:A4) wll do it because SUM()
ignores text. I know that you didn't ask that but......


To count the number of cells with an N then try:

=COUNTA(A1:A4)-COUNT(A1:A4)

--
HTH

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 
S

Sandy Mann

pinmaster,
=SUM(IF(RIGHT(A1:A10)="n",ABS(LEFT(A1:A10,LEN(A1:A10)-1))))

Why did you include the ABS() function?


--
Regards,

Sandy
In Perth, the ancient capital of Scotland
and the crowning place of kings

(e-mail address removed)
(e-mail address removed) with @tiscali.co.uk
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top