Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
bpa bpa is offline
external usenet poster
 
Posts: 5
Default Formula help

I haven't used Excel in a while. I am trying to figure out how to create a
formula to display the result of subtracting different cells in a row. For
example:
n=a1-b1 with result showing in n; then when I update the next time I want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to do
this???

Thanks in advance!

  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Formula help

In Cell B2, type

=A1-B1

then copy cell B2 and paste to C2 and so on, to match your last cell in row
1

HTH,
Bernie
MS Excel MVP


"bpa" wrote in message
...
I haven't used Excel in a while. I am trying to figure out how to create a
formula to display the result of subtracting different cells in a row.
For
example:
n=a1-b1 with result showing in n; then when I update the next time I want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to do
this???

Thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.newusers
bpa bpa is offline
external usenet poster
 
Posts: 5
Default Formula help

Hi Bernie,
Thank you for answering. Maybe I'm not understanding, or maybe not clear
enough on what I am looking for. I need the result from the calculation to
be on the same row, i.e. N1 and for the number in N1 to change as I add in
additional values in the same row. I tried your idea and the formatting
flowed properly, but when I added data in the cells going across, the
formatting disappears and the calculations no longer work?? I can always
change the formula in the N column and copy it down to the remainder of the
rows, but was hoping for an "automated" way!! Maybe wishful thinking on my
part? Thanks again!
Brenda

"Bernie Deitrick" wrote:

In Cell B2, type

=A1-B1

then copy cell B2 and paste to C2 and so on, to match your last cell in row
1

HTH,
Bernie
MS Excel MVP


"bpa" wrote in message
...
I haven't used Excel in a while. I am trying to figure out how to create a
formula to display the result of subtracting different cells in a row.
For
example:
n=a1-b1 with result showing in n; then when I update the next time I want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to do
this???

Thanks in advance!




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 32
Default Formula help

In O1 copy and paste this:
=IF(AND(ISBLANK(C1),ISBLANK(D1),ISBLANK(E1),ISBLAN K(F1),ISBLANK(G1),ISBLANK(H1),ISBLANK(I1),ISBLANK( J1),ISBLANK(K1),ISBLANK(L1),ISBLANK(M1)),B1-A1,IF(AND(ISBLANK(D1),ISBLANK(E1),ISBLANK(F1),ISBL ANK(G1),ISBLANK(H1),ISBLANK(I1),ISBLANK(J1),ISBLAN K(K1),ISBLANK(L1),ISBLANK(M1)),C1-B1,IF(AND(ISBLANK(E1),ISBLANK(F1),ISBLANK(G1),ISBL ANK(H1),ISBLANK(I1),ISBLANK(J1),ISBLANK(K1),ISBLAN K(L1),ISBLANK(M1)),D1-C1,IF(AND(ISBLANK(F1),ISBLANK(G1),ISBLANK(H1),ISBL ANK(I1),ISBLANK(J1),ISBLANK(K1),ISBLANK(L1),ISBLAN K(M1)),E1-D1,IF(AND(ISBLANK(G1),ISBLANK(H1),ISBLANK(I1),ISBL ANK(J1),ISBLANK(K1),ISBLANK(L1),ISBLANK(M1)),F1-E1,IF(AND(ISBLANK(H1),ISBLANK(I1),ISBLANK(J1),ISBL ANK(K1),ISBLANK(L1),ISBLANK(M1)),G1-F1))))))

Name cell O1: Part1

In P1, copy and paste this:
=IF(AND(ISBLANK(I1),ISBLANK(J1),ISBLANK(K1),ISBLAN K(L1),ISBLANK(M1)),H1-G1,IF(AND(ISBLANK(J1),ISBLANK(K1),ISBLANK(L1),ISBL ANK(M1)),I1-H1,IF(AND(ISBLANK(K1),ISBLANK(L1),ISBLANK(M1)),J1-I1,IF(AND(ISBLANK(L1),ISBLANK(M1)),K1-J1,IF(AND(ISBLANK(M1)),L1-K1,M1-L1)))))

Name cell P1: Part2

In N1 type: =IF(Part1,Part1,Part2)

That should do it.

"bpa" wrote:

Hi Bernie,
Thank you for answering. Maybe I'm not understanding, or maybe not clear
enough on what I am looking for. I need the result from the calculation to
be on the same row, i.e. N1 and for the number in N1 to change as I add in
additional values in the same row. I tried your idea and the formatting
flowed properly, but when I added data in the cells going across, the
formatting disappears and the calculations no longer work?? I can always
change the formula in the N column and copy it down to the remainder of the
rows, but was hoping for an "automated" way!! Maybe wishful thinking on my
part? Thanks again!
Brenda

"Bernie Deitrick" wrote:

In Cell B2, type

=A1-B1

then copy cell B2 and paste to C2 and so on, to match your last cell in row
1

HTH,
Bernie
MS Excel MVP


"bpa" wrote in message
...
I haven't used Excel in a while. I am trying to figure out how to create a
formula to display the result of subtracting different cells in a row.
For
example:
n=a1-b1 with result showing in n; then when I update the next time I want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to do
this???

Thanks in advance!




  #5   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 168
Default Formula help

Hi Brenda,

Do you mean that the formula in N1 will always subtract
the last two values entered in A1 to M1.

If that is the case then try this in N1.
=INDEX(A1:M1,LARGE(IF(LEN(A1:M1)0,COLUMN(A1:M1)), 2))-LOOKUP(1E+100,A1:M1)

That is an array formula and must be comitted by using
Ctrl+Shft+Enter and not just Enter.

As you enter values across row 1 it will update and
only subtract the last two values.

HTH
Martin


"bpa" wrote in message
...
Hi Bernie,
Thank you for answering. Maybe I'm not understanding, or maybe not clear
enough on what I am looking for. I need the result from the calculation
to
be on the same row, i.e. N1 and for the number in N1 to change as I add in
additional values in the same row. I tried your idea and the formatting
flowed properly, but when I added data in the cells going across, the
formatting disappears and the calculations no longer work?? I can always
change the formula in the N column and copy it down to the remainder of
the
rows, but was hoping for an "automated" way!! Maybe wishful thinking on
my
part? Thanks again!
Brenda

"Bernie Deitrick" wrote:

In Cell B2, type

=A1-B1

then copy cell B2 and paste to C2 and so on, to match your last cell in
row
1

HTH,
Bernie
MS Excel MVP


"bpa" wrote in message
...
I haven't used Excel in a while. I am trying to figure out how to
create a
formula to display the result of subtracting different cells in a row.
For
example:
n=a1-b1 with result showing in n; then when I update the next time I
want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to
do
this???

Thanks in advance!








  #6   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,651
Default Formula help

On Fri, 1 Aug 2008 15:15:01 -0700, bpa wrote:

I haven't used Excel in a while. I am trying to figure out how to create a
formula to display the result of subtracting different cells in a row. For
example:
n=a1-b1 with result showing in n; then when I update the next time I want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to do
this???

Thanks in advance!



If I understand you correctly, you will be entering numbers sequentially in A1,
B1, C1 etc.

You want the subtraction of the last number entered from the next-to-last
number entered to appear in N1.

I assume the last value would be entered in M1.

That being the case, try this formula:

=OFFSET(N1,0,COUNT(A1:M1)-COLUMN(N1)-1)-
OFFSET(N1,0,COUNT(A1:M1)-COLUMN(N1))

--ron
  #7   Report Post  
Posted to microsoft.public.excel.newusers
bpa bpa is offline
external usenet poster
 
Posts: 5
Default Formula help

Thank you - this approach worked!!
Brenda

"Guy Lydig" wrote:

In O1 copy and paste this:
=IF(AND(ISBLANK(C1),ISBLANK(D1),ISBLANK(E1),ISBLAN K(F1),ISBLANK(G1),ISBLANK(H1),ISBLANK(I1),ISBLANK( J1),ISBLANK(K1),ISBLANK(L1),ISBLANK(M1)),B1-A1,IF(AND(ISBLANK(D1),ISBLANK(E1),ISBLANK(F1),ISBL ANK(G1),ISBLANK(H1),ISBLANK(I1),ISBLANK(J1),ISBLAN K(K1),ISBLANK(L1),ISBLANK(M1)),C1-B1,IF(AND(ISBLANK(E1),ISBLANK(F1),ISBLANK(G1),ISBL ANK(H1),ISBLANK(I1),ISBLANK(J1),ISBLANK(K1),ISBLAN K(L1),ISBLANK(M1)),D1-C1,IF(AND(ISBLANK(F1),ISBLANK(G1),ISBLANK(H1),ISBL ANK(I1),ISBLANK(J1),ISBLANK(K1),ISBLANK(L1),ISBLAN K(M1)),E1-D1,IF(AND(ISBLANK(G1),ISBLANK(H1),ISBLANK(I1),ISBL ANK(J1),ISBLANK(K1),ISBLANK(L1),ISBLANK(M1)),F1-E1,IF(AND(ISBLANK(H1),ISBLANK(I1),ISBLANK(J1),ISBL ANK(K1),ISBLANK(L1),ISBLANK(M1)),G1-F1))))))

Name cell O1: Part1

In P1, copy and paste this:
=IF(AND(ISBLANK(I1),ISBLANK(J1),ISBLANK(K1),ISBLAN K(L1),ISBLANK(M1)),H1-G1,IF(AND(ISBLANK(J1),ISBLANK(K1),ISBLANK(L1),ISBL ANK(M1)),I1-H1,IF(AND(ISBLANK(K1),ISBLANK(L1),ISBLANK(M1)),J1-I1,IF(AND(ISBLANK(L1),ISBLANK(M1)),K1-J1,IF(AND(ISBLANK(M1)),L1-K1,M1-L1)))))

Name cell P1: Part2

In N1 type: =IF(Part1,Part1,Part2)

That should do it.

"bpa" wrote:

Hi Bernie,
Thank you for answering. Maybe I'm not understanding, or maybe not clear
enough on what I am looking for. I need the result from the calculation to
be on the same row, i.e. N1 and for the number in N1 to change as I add in
additional values in the same row. I tried your idea and the formatting
flowed properly, but when I added data in the cells going across, the
formatting disappears and the calculations no longer work?? I can always
change the formula in the N column and copy it down to the remainder of the
rows, but was hoping for an "automated" way!! Maybe wishful thinking on my
part? Thanks again!
Brenda

"Bernie Deitrick" wrote:

In Cell B2, type

=A1-B1

then copy cell B2 and paste to C2 and so on, to match your last cell in row
1

HTH,
Bernie
MS Excel MVP


"bpa" wrote in message
...
I haven't used Excel in a while. I am trying to figure out how to create a
formula to display the result of subtracting different cells in a row.
For
example:
n=a1-b1 with result showing in n; then when I update the next time I want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to do
this???

Thanks in advance!




  #8   Report Post  
Posted to microsoft.public.excel.newusers
bpa bpa is offline
external usenet poster
 
Posts: 5
Default Formula help

Thank you, Martin!

"MartinW" wrote:

Hi Brenda,

Do you mean that the formula in N1 will always subtract
the last two values entered in A1 to M1.

If that is the case then try this in N1.
=INDEX(A1:M1,LARGE(IF(LEN(A1:M1)0,COLUMN(A1:M1)), 2))-LOOKUP(1E+100,A1:M1)

That is an array formula and must be comitted by using
Ctrl+Shft+Enter and not just Enter.

As you enter values across row 1 it will update and
only subtract the last two values.

HTH
Martin


"bpa" wrote in message
...
Hi Bernie,
Thank you for answering. Maybe I'm not understanding, or maybe not clear
enough on what I am looking for. I need the result from the calculation
to
be on the same row, i.e. N1 and for the number in N1 to change as I add in
additional values in the same row. I tried your idea and the formatting
flowed properly, but when I added data in the cells going across, the
formatting disappears and the calculations no longer work?? I can always
change the formula in the N column and copy it down to the remainder of
the
rows, but was hoping for an "automated" way!! Maybe wishful thinking on
my
part? Thanks again!
Brenda

"Bernie Deitrick" wrote:

In Cell B2, type

=A1-B1

then copy cell B2 and paste to C2 and so on, to match your last cell in
row
1

HTH,
Bernie
MS Excel MVP


"bpa" wrote in message
...
I haven't used Excel in a while. I am trying to figure out how to
create a
formula to display the result of subtracting different cells in a row.
For
example:
n=a1-b1 with result showing in n; then when I update the next time I
want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to
do
this???

Thanks in advance!







  #9   Report Post  
Posted to microsoft.public.excel.newusers
bpa bpa is offline
external usenet poster
 
Posts: 5
Default Formula help

Thank you!

"Ron Rosenfeld" wrote:

On Fri, 1 Aug 2008 15:15:01 -0700, bpa wrote:

I haven't used Excel in a while. I am trying to figure out how to create a
formula to display the result of subtracting different cells in a row. For
example:
n=a1-b1 with result showing in n; then when I update the next time I want
n=b1-c1
and so on for the remainder of the cells in row 1. Is there a way to do
this???

Thanks in advance!



If I understand you correctly, you will be entering numbers sequentially in A1,
B1, C1 etc.

You want the subtraction of the last number entered from the next-to-last
number entered to appear in N1.

I assume the last value would be entered in M1.

That being the case, try this formula:

=OFFSET(N1,0,COUNT(A1:M1)-COLUMN(N1)-1)-
OFFSET(N1,0,COUNT(A1:M1)-COLUMN(N1))

--ron

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



All times are GMT +1. The time now is 02:22 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"