Formula Problems-Zero Results Need to be Blank & Calculation Needs to Pickup from Previous Amount Greater Than Zero

KarenG

New Member
Joined
Aug 31, 2012
Messages
10
Office Version
  1. 365
Platform
  1. Windows
  2. Web
Hello,

I'm a beginner when it comes to formulas and this particular spreadsheet is giving me 2 issues.

The zero amounts in the 2nd column need to be blank. I got the first one to work but that's it. Then I have a problem where the 859910 is the second column shows up. It needs to be the 859910 in the first column minus the 858650 in the first column so that 1260 is the result in the 2nd column (in place of 859910)
[TABLE="class: grid, width: 209"]
<tbody>[TR]
[TD]855000[/TD]
[TD="align: center"]//////////[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]856120[/TD]
[TD="align: right"]1120[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]857330[/TD]
[TD="align: right"]1210[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]858650[/TD]
[TD="align: right"]1320[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD] [/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]0[/TD]
[TD="align: right"]0[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]859910[/TD]
[TD="align: right"]859910[/TD]
[TD="align: right"]1260[/TD]
[/TR]
[TR]
[TD="align: right"]861150[/TD]
[TD="align: right"]1240[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]862300[/TD]
[TD="align: right"]1150[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]863550[/TD]
[TD="align: right"]1250[/TD]
[TD][/TD]
[/TR]
[TR]
[TD="align: right"]864860[/TD]
[TD="align: right"]1310[/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col><col></colgroup>[/TABLE]

Below is the table showing what I've done with the formula.
[TABLE="class: grid, width: 417"]
<tbody>[TR]
[TD]855000[/TD]
[TD="align: center"] //////////////////////////////////[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]856120[/TD]
[TD]=IF(A2-A1>=0,A2-A1,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]857330[/TD]
[TD]=IF(A3-A2>=0,A3-A2,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]858650[/TD]
[TD]=IF(A4-A3>=0,A4-A3,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]=IF(A5-A4>=0,A5-A4,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]=IF(A6-A5>=0,A6-A5,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]=IF(A7-A6>=0,A7-A6,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]=IF(A8-A7>=0,A8-A7,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]0[/TD]
[TD]=IF(A9-A8>=0,A9-A8,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]859910[/TD]
[TD]=IF(A10-A9>=0,A10-A9,"")[/TD]
[TD]1260[/TD]
[/TR]
[TR]
[TD]861150[/TD]
[TD]=IF(A11-A10>=0,A11-A10,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]862300[/TD]
[TD]=IF(A12-A11>=0,A12-A11,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]863550[/TD]
[TD]=IF(A13-A12>=0,A13-A12,"")[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]864860[/TD]
[TD]=IF(A14-A13>=0,A14-A13,"")[/TD]
[TD][/TD]
[/TR]
</tbody><colgroup><col><col><col></colgroup>[/TABLE]

I hope this makes sense. I'm using Excel 2013. Thanks in advance for any help you can provide.

Karen
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Hi,

If I understand correctly, this would achieve what you want:


Book1
AB
1855000//////////
28561201120
38573301210
48586501320
50
60
70
80
90
108599101260
118611501240
128623001150
138635501250
148648601310
Sheet2
Cell Formulas
RangeFormula
B2=IF(AND(A1=0,A2<>0),A2-LOOKUP(9.99999999999999E+307,B$1:B1,A$1:A1),IF(A2-A1>0,A2-A1,""))


B2 formula copied down.
 
Upvote 0
You got it but when I copy and pasted the formula it's good until cell B10 where it displays 859910. Also, any help in actually understanding the formula would be wonderful.
 
Upvote 0
Hi,

It shouldn't show 859910 in B10, works for me as shown:


Book1
AB
1855000//////////
28561201120
38573301210
48586501320
50
60
70
80
90
108599101260
118611501240
128623001150
138635501250
148648601310
Sheet2
Cell Formulas
RangeFormula
B2=IF(AND(A1=0,A2<>0),A2-LOOKUP(9.99999999999999E+307,B$1:B1,A$1:A1),IF(A2-A1>0,A2-A1,""))
B10=IF(AND(A9=0,A10<>0),A10-LOOKUP(9.99999999999999E+307,B$1:B9,A$1:A9),IF(A10-A9>0,A10-A9,""))


Let's get it working for you first, I'll explain the formula later.
 
Last edited:
Upvote 0
I have a feeling your 0 values in Column A is TEXT, how do the 0s get there?
Is it manually entered, or from a formula?
If it's from a formula, please post the formula.
 
Upvote 0
Finally, it worked. I was one cell off when I posted the formula. Just for an FYI the zeros are entered manually and it is formatted as GENERAL. Now, for the explanation please.
 
Upvote 0
Glad you got it working.

For the explanation, I'll use the formula as it sits in B10 after being copied down from B2:


Book1
B
101260
Sheet2
Cell Formulas
RangeFormula
B10=IF(AND(A9=0,A10<>0),A10-LOOKUP(9.99999999999999E+307,B$1:B9,A$1:A9),IF(A10-A9>0,A10-A9,""))


If both A9=0 And A10 does Not =0, then A10 minus (LOOKUP, using BIGNUM, 9.9999999999999999E+307, which finds the last value in range of B$1:B9, in this case 1320, and return the corresponding value in A$1:A9, in this case, 858650); otherwise, test if A10-A9 is Greater than 0, if it is, than give the result of A10-A9, if it's Not, leave cell Blank, this part keeps the cells Blank with 0s in Column A.

Hope this explains it.
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,337
Members
452,637
Latest member
Ezio2866

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top