Excel assistance

dsain

Junior Member
Mar 22, 2017
3
0
1
I have an excel sheet that I need assistance with. It has three columns : Deposits, Withdrawals, Receipt Number.

I need a formula that when there is a withdrawal from the account it is a reciept number. Each month would start at 0. The formula needs to leave a blank in the column if it is a deposit but one a withdrawal is shown it will locate the previous total and add 1 to it.

Example :

Deposit (blank) Withdrawal = $10 Reciept # =1
Deposit $10 Withdrawal (blank) Reciept (blank)
Deposit (blank) Withdrawl =$30 Reciept #=2

Sorrt about the example, it would not let me set it up like a table.

Thanks everyone for your help.
 

cbrunny

Diamond Member
Oct 12, 2007
6,791
406
126
Deposit is column A
Withdrawal is column B
Receipt # is column C

in C2, write this:
=IF(B2=0,"-",count($C$2:$C2)+1)

and copy the formula down column C. I think it should work. If you don't want a dash to appear in column C when there is no receipt number, you can replace it with a blank space.
 

dsain

Junior Member
Mar 22, 2017
3
0
1
Deposit is column A
Withdrawal is column B
Receipt # is column C

in C2, write this:
=IF(B2=0,"-",count($C$2:$C2)+1)

and copy the formula down column C. I think it should work. If you don't want a dash to appear in column C when there is no receipt number, you can replace it with a blank space.
the dash is working, but the count will not go up.
 

hardhat

Senior member
Dec 4, 2011
422
114
116
It doesn't increment correctly. You can do that with something like this:
A.......................B..............C...................D
Transaction......Deposit.....Withdrawal....Receipt #
1..............................................................1
=A2+1...................................................... =IF(C3=0,"-",A2-COUNTIF($D$2: D2,"-")+1)

Unnecessary space in formula to avoid emoticon.
 
Last edited: