# Calculating the remaining time for each DVD

I have created a list of all my recordings on DVDs. As I will have more than 99 Titles, I have set the DVD № in Cx to 000. I need to show the remaining time, so that I can easily find the DVDs with space for more recordings. Each side has 6 hours of recording.

With the recordings listed in the column Ax, the DVD № are in the column Cx, starting with C(1) = “001”. The number of C-cells containing “001” varies w.r.t. to number of recordings on this first DVD. Similarly, for all subsequent C-cells.
Therein lies my problem in calculating the Remaining Time for each DVD.
I currently have the following entries for Cx:

C(2)=001; C(3)=001; C(4)=001; C(5)=002; C(6)=002; C(7)=003;

C(8)=003; C(9)=003; C(10)=003; C(11)=003; C(12)=004.

I started writing a nested IF-statement, but soon realised this would be enormous and prone to error:
=IF(C2=C3;IF(C3=C4;IF(C4=C5;D4=0;D4=C4);D3=C3);D2=C2)

I really have run out of steam, and would appreciate any assistance offered. Surely, there must be somebody having had a similar task.
Is there a means of incrementing C(X) until its content changes - i.e. “001” until “002”?
Thank you.

Original question title: LO 4.2.8.2, EN (BR), Calc >> Ubuntu 14.04 & Win XP

D2: `=IF(C2=C1;D1+B2;B2)`

E2: `=IF(C2<>C3;0.25-D2;"")`

Applied Data Bar format to columns D and E. Use menu `Format` - `Conditional` - `Manage…` to edit.

See sample file.

Made with LibreOffice 6.4.7.2 (x86); OS: Windows 6.1.