ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel Formula Help With Subtraction (https://www.excelbanter.com/excel-discussion-misc-queries/237545-excel-formula-help-subtraction.html)

Jeremy

Excel Formula Help With Subtraction
 
I am looking for a formula to subtract cells if certain criteria match. See
example below.


Data that is given
A B C
1 123 4
2 123 7
3 124 8
4 124 12
5 125 10
6 125 20
7

Data in C with formula
A B C
1 123 4
2 123 7 3
3 124 8
4 124 12 4
5 125 10
6 125 20 10
7


PJ

Excel Formula Help With Subtraction
 
Hi Jeremy

Is this what you need?

In C2 =IF(A1=A2,B2-B1,"") and drag the formula down to the bottom of
your list.

"Jeremy" wrote:

I am looking for a formula to subtract cells if certain criteria match. See
example below.


Data that is given
A B C
1 123 4
2 123 7
3 124 8
4 124 12
5 125 10
6 125 20
7

Data in C with formula
A B C
1 123 4
2 123 7 3
3 124 8
4 124 12 4
5 125 10
6 125 20 10
7


joel

Excel Formula Help With Subtraction
 
Put in C2

=if(A1=A2,B2-B1,"")

Copy down column. Since C1 will never have any results leave it blank.

"Jeremy" wrote:

I am looking for a formula to subtract cells if certain criteria match. See
example below.


Data that is given
A B C
1 123 4
2 123 7
3 124 8
4 124 12
5 125 10
6 125 20
7

Data in C with formula
A B C
1 123 4
2 123 7 3
3 124 8
4 124 12 4
5 125 10
6 125 20 10
7



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com