Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Looking for a formula to perform this additions

I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the number
part of G308 and the number part of I308) and J338=6 (4+2, the number part of
H308 and the number part of J308)
I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,059
Default Looking for a formula to perform this additions

"Ayo" wrote:
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the number part
of
H308 and the number part of J308)


If the number before the letter is always one digit, then:

G338: =--left(G308,1)
H338: =--left(H308,1)
I338: =G338 + left(I308,1)
J338: =H338 + left(J308,1)

Alternatively, if the number before the letter might have multiple digits,
but the right-hand text is always a single letter, then replace LEFT(G308,1)
with LEFT(G308,LEN(308)-1), and similarly for the other LEFT expressions.


I got a formula that would do the additions for me, array-entered,
=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.


I don't see how that formula relates to the first part of the question, so I
don't know how to fix it so that it accommodates the As and Ps.


----- original message -----

"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the number part
of
H308 and the number part of J308)

I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Looking for a formula to perform this additions

G308=4A, H308=4P, I308=3A and J308=2P
take into account the As and Ps.


Do the cells *always* contain a single digit followed by a letter? Are there
any empty cells in the range? Are there any formulas in the range that
return formula blanks ("")?

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the number part
of
H308 and the number part of J308)
I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks




  #4   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Looking for a formula to perform this additions

I would be some empty cells in the range and yes, it will only be A and P and
the cells could be any number of digits, i.e, it could be 24A or 124A, 3P or
344P. I am trying to do a cumulative addition based on whether the cell value
ends in A or P and also adding all the previous cells.

"T. Valko" wrote:

G308=4A, H308=4P, I308=3A and J308=2P
take into account the As and Ps.


Do the cells *always* contain a single digit followed by a letter? Are there
any empty cells in the range? Are there any formulas in the range that
return formula blanks ("")?

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the number part
of
H308 and the number part of J308)
I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks





  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Looking for a formula to perform this additions

Assuming that *every* cell that contains a letter P or A *also* contains a
number.

Try one of these array formula** :

=SUM(IF(RIGHT(A1:H1)="P",--SUBSTITUTE(A1:H1,"P","")))

=SUM(IF(RIGHT(A1:H1)="P",--LEFT(A1:H1,LEN(A1:H1)-1)))

The difference in these formulas is that the first one assumes the letter in
the cell will *always* be an upper case letter. In the second formula it
doesn't matter what case the letter is.

** 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


"Ayo" wrote in message
...
I would be some empty cells in the range and yes, it will only be A and P
and
the cells could be any number of digits, i.e, it could be 24A or 124A, 3P
or
344P. I am trying to do a cumulative addition based on whether the cell
value
ends in A or P and also adding all the previous cells.

"T. Valko" wrote:

G308=4A, H308=4P, I308=3A and J308=2P
take into account the As and Ps.


Do the cells *always* contain a single digit followed by a letter? Are
there
any empty cells in the range? Are there any formulas in the range that
return formula blanks ("")?

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on
for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the number
part
of
H308 and the number part of J308)
I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks









  #6   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Looking for a formula to perform this additions

Thanks Valko. I think it works but the cell is only show TRUE. How do I get
it to show the result of the SUM(), which in this case is 16?

"T. Valko" wrote:

Assuming that *every* cell that contains a letter P or A *also* contains a
number.

Try one of these array formula** :

=SUM(IF(RIGHT(A1:H1)="P",--SUBSTITUTE(A1:H1,"P","")))

=SUM(IF(RIGHT(A1:H1)="P",--LEFT(A1:H1,LEN(A1:H1)-1)))

The difference in these formulas is that the first one assumes the letter in
the cell will *always* be an upper case letter. In the second formula it
doesn't matter what case the letter is.

** 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


"Ayo" wrote in message
...
I would be some empty cells in the range and yes, it will only be A and P
and
the cells could be any number of digits, i.e, it could be 24A or 124A, 3P
or
344P. I am trying to do a cumulative addition based on whether the cell
value
ends in A or P and also adding all the previous cells.

"T. Valko" wrote:

G308=4A, H308=4P, I308=3A and J308=2P
take into account the As and Ps.

Do the cells *always* contain a single digit followed by a letter? Are
there
any empty cells in the range? Are there any formulas in the range that
return formula blanks ("")?

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on
for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the number
part
of
H308 and the number part of J308)
I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks








  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Looking for a formula to perform this additions

the cell is only show TRUE.

Hmmm...

The formulas I posted will *never* return TRUE.

Post the *exact* formula you tried.

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
Thanks Valko. I think it works but the cell is only show TRUE. How do I
get
it to show the result of the SUM(), which in this case is 16?

"T. Valko" wrote:

Assuming that *every* cell that contains a letter P or A *also* contains
a
number.

Try one of these array formula** :

=SUM(IF(RIGHT(A1:H1)="P",--SUBSTITUTE(A1:H1,"P","")))

=SUM(IF(RIGHT(A1:H1)="P",--LEFT(A1:H1,LEN(A1:H1)-1)))

The difference in these formulas is that the first one assumes the letter
in
the cell will *always* be an upper case letter. In the second formula it
doesn't matter what case the letter is.

** 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


"Ayo" wrote in message
...
I would be some empty cells in the range and yes, it will only be A and
P
and
the cells could be any number of digits, i.e, it could be 24A or 124A,
3P
or
344P. I am trying to do a cumulative addition based on whether the cell
value
ends in A or P and also adding all the previous cells.

"T. Valko" wrote:

G308=4A, H308=4P, I308=3A and J308=2P
take into account the As and Ps.

Do the cells *always* contain a single digit followed by a letter? Are
there
any empty cells in the range? Are there any formulas in the range that
return formula blanks ("")?

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on
for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the
number
part
of
H308 and the number part of J308)
I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks










  #8   Report Post  
Posted to microsoft.public.excel.misc
Ayo Ayo is offline
external usenet poster
 
Posts: 489
Default Looking for a formula to perform this additions

Thanks. I figured out what the problem was; I had two formulas in the same
cell. That was why I was getting that error.
Thank you so much.

"T. Valko" wrote:

the cell is only show TRUE.


Hmmm...

The formulas I posted will *never* return TRUE.

Post the *exact* formula you tried.

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
Thanks Valko. I think it works but the cell is only show TRUE. How do I
get
it to show the result of the SUM(), which in this case is 16?

"T. Valko" wrote:

Assuming that *every* cell that contains a letter P or A *also* contains
a
number.

Try one of these array formula** :

=SUM(IF(RIGHT(A1:H1)="P",--SUBSTITUTE(A1:H1,"P","")))

=SUM(IF(RIGHT(A1:H1)="P",--LEFT(A1:H1,LEN(A1:H1)-1)))

The difference in these formulas is that the first one assumes the letter
in
the cell will *always* be an upper case letter. In the second formula it
doesn't matter what case the letter is.

** 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


"Ayo" wrote in message
...
I would be some empty cells in the range and yes, it will only be A and
P
and
the cells could be any number of digits, i.e, it could be 24A or 124A,
3P
or
344P. I am trying to do a cumulative addition based on whether the cell
value
ends in A or P and also adding all the previous cells.

"T. Valko" wrote:

G308=4A, H308=4P, I308=3A and J308=2P
take into account the As and Ps.

Do the cells *always* contain a single digit followed by a letter? Are
there
any empty cells in the range? Are there any formulas in the range that
return formula blanks ("")?

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so on
for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3, the
number
part of G308 and the number part of I308) and J338=6 (4+2, the
number
part
of
H308 and the number part of J308)
I got a formula that would do the additions for me, array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need is
something similar that would take into account the As and Ps.

Any ideas. Thanks











  #9   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Looking for a formula to perform this additions

Ok, good deal. Thanks for the feedback!

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
Thanks. I figured out what the problem was; I had two formulas in the same
cell. That was why I was getting that error.
Thank you so much.

"T. Valko" wrote:

the cell is only show TRUE.


Hmmm...

The formulas I posted will *never* return TRUE.

Post the *exact* formula you tried.

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
Thanks Valko. I think it works but the cell is only show TRUE. How do I
get
it to show the result of the SUM(), which in this case is 16?

"T. Valko" wrote:

Assuming that *every* cell that contains a letter P or A *also*
contains
a
number.

Try one of these array formula** :

=SUM(IF(RIGHT(A1:H1)="P",--SUBSTITUTE(A1:H1,"P","")))

=SUM(IF(RIGHT(A1:H1)="P",--LEFT(A1:H1,LEN(A1:H1)-1)))

The difference in these formulas is that the first one assumes the
letter
in
the cell will *always* be an upper case letter. In the second formula
it
doesn't matter what case the letter is.

** 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


"Ayo" wrote in message
...
I would be some empty cells in the range and yes, it will only be A
and
P
and
the cells could be any number of digits, i.e, it could be 24A or
124A,
3P
or
344P. I am trying to do a cumulative addition based on whether the
cell
value
ends in A or P and also adding all the previous cells.

"T. Valko" wrote:

G308=4A, H308=4P, I308=3A and J308=2P
take into account the As and Ps.

Do the cells *always* contain a single digit followed by a letter?
Are
there
any empty cells in the range? Are there any formulas in the range
that
return formula blanks ("")?

--
Biff
Microsoft Excel MVP


"Ayo" wrote in message
...
I have the following: G308=4A, H308=4P, I308=3A and J308=2P and so
on
for
that row.
Now I want the following to happen: G338=4, H338=4, I338=7 (4+3,
the
number
part of G308 and the number part of I308) and J338=6 (4+2, the
number
part
of
H308 and the number part of J308)
I got a formula that would do the additions for me,
array-entered,

=$F5+SUM(IF(MOD(COLUMN($G$5:G$5),2)=MOD(COLUMN(G5) ,2),$G5:G5,0))

if I didn't have the As and Ps in row 308. But what I really need
is
something similar that would take into account the As and Ps.

Any ideas. Thanks













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
What is the formula for compounding interest with annual additions charrismd Excel Worksheet Functions 2 April 25th 23 11:48 AM
How do I perform a different formula on the same cell range? erinlm Excel Worksheet Functions 2 April 9th 08 10:04 PM
What function does ^ perform in a formula Mickford Excel Worksheet Functions 1 October 15th 07 06:25 PM
what excel formula will perform a running subtract from one value AMcV Excel Discussion (Misc queries) 1 November 14th 06 12:13 PM
Using a formula to perform multiple functions. elusiverunner Excel Discussion (Misc queries) 3 October 1st 06 11:31 PM


All times are GMT +1. The time now is 02:22 AM.

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

About Us

"It's about Microsoft Excel"