Increment a cell value - conditions applied [Solved/Closed]

peweuk 3 Posts Sunday February 1, 2015Registration date February 5, 2015 Last seen - Feb 1, 2015 at 08:26 AM - Latest reply: peweuk 3 Posts Sunday February 1, 2015Registration date February 5, 2015 Last seen
- Feb 1, 2015 at 01:01 PM
Hello,
I needed a formula to add a value to a cell when the cell next to it contains a value where that value is obtained by incrementing the value in the previous cell by 1.

I used the following formula:

=IF(B4<>"",A3+1,"")

Example.
A3 contains a value of 1.
The formula in A4 monitors cell B4 and if a value is entered in B4 then a value is placed in A4 which equates to A3+1 (ie value of 2).


This works well enough as seen in rows 3-6 above, BUT when the previous cell in column A contains no value - such as cell A in row 7 in the example above, the formula no longer works in cell A8

What I need to do is somehow amend the formula (or use some other method) so that the cell which is incremented in column A is the last one in the column which contained a value.

I hope this all makes sense and wonder if anyone can assist with suggestions for a solution?

TIA

See more 

2 replies

RayH 122 Posts Tuesday August 31, 2010Registration dateContributorStatus June 20, 2016 Last seen - Feb 1, 2015 at 12:01 PM
0
Thank you
in Cell A4 and drag down.


=IF(B4<>"",IFERROR(COUNTIF(B$3:B3,"<>")+1,""),"")
peweuk 3 Posts Sunday February 1, 2015Registration date February 5, 2015 Last seen - Feb 1, 2015 at 01:01 PM
Excellent - it works beautifully.
Much appreciated.
It would have taken me ages to come even close to a formula like this. ;)