# Generate value depending on the 5 digit decimal numbers



## hsandeep (Jan 5, 2023)

Range C3:C8 generates numerical values which are decimal numbers or 0. These decimal numbers have 5 digit whole numbers and fractional part.
D2= generates numerical values
E2= generates numerical values

Output range *F3:F8* required such that
Example for C3 (42583.569)
IF ceiling(C3,E2)<=C3+D2, then C3=E2+ceiling(C3,E2)
IF ceiling(C3,E2)>C3+D2, then C3=ceiling(C3,E2)
& so on for C4:C8
How to accomplish?
Thanks in advance.

Book2.xlsxCDEF220100342583.56942700.000442987.23043100.000542950.00043000.000642980.00043100.000743000.00043100.000842220.00042300.000Sheet2


----------



## ExceLoki (Jan 5, 2023)

try this
----------
Book1CDEF220100342583.56942700.000442987.23043100.000542950.00043000.000642980.00043100.000743000.00043100.000842220.00042300.000Sheet1Cell FormulasRangeFormulaF3:F8F3=IF(CEILING(C3,$E$2)<=C3+$D$2,($E$2+(CEILING(C3,$E$2))),(CEILING(C3,$E$2)))


----------



## Eric W (Jan 5, 2023)

Same basic idea:

Book1ABCDEF1220100342583.56942700.000442987.23043100.000542950.00043000.000642980.00043100.000743000.00043100.000842220.00042300.000Sheet4Cell FormulasRangeFormulaF3:F8F3=CEILING(C3,$E$2)+IF(CEILING(C3,$E$2)<=C3+$D$2,$E$2)


----------



## hsandeep (Jan 5, 2023)

Eric W said:


> Same basic idea:
> 
> Book1ABCDEF1220100342583.56942700.000442987.23043100.000542950.00043000.000642980.00043100.000743000.00043100.000842220.00042300.000Sheet4Cell FormulasRangeFormulaF3:F8F3=CEILING(C3,$E$2)+IF(CEILING(C3,$E$2)<=C3+$D$2,$E$2)


Thanks Eric W Your formula works & meets my requirement.  Very nice approach "Short & Accurate".


----------



## Phuoc (Jan 5, 2023)

Another way

=CEILING(C3+$D$2+0.00001,$E$2)


----------



## hsandeep (Jan 6, 2023)

Phuoc said:


> Another way
> 
> =CEILING(C3+$D$2+0.00001,$E$2)


Superb..I liked the 'mathematics' involved in the formula (use of 0.00001). Thanks Phuoc


----------

