Free Support Forum - aspose.com

Making cell Number property as Percentage of ##.##% with already as formula

sir i am trying to make a cell with a formula as percentage so i did

cells(0, 1).Formula = "=ROUND(((C" & start + 2 & ")/C" & tcount + 1 & "),2)"

cells1(0, 1).Style.Number = 10

i am expecting the result as 26.24%,but it is giving me the result as 0.2624 and also it is not showing me the percentage sign

then i tried this
cells(start + 1, 3).PutValue(".2624")
cells1(0, 1).Style.Number = 10
so it gave me the right result as 26.24

so i would like you to help me to make a cell as percentage with already as formula

i am hereby attaching a excel file for your reference

Kindly help

i am currently using

aspose.cell V 4.0.1.0

waiting for your reply

thanks

Zaid

Hi Zaid,

I tried your scenario with the attached latest version of Aspose.Cells and it works fine. Please try the attached latest version and let us know if it works fine for you.

Thank You & Best Regards,

Hi,

i tried the same using the latest version of aspose.cells but i dint work the problem is when i apply a formula like this cells(0, 1).Formula = "=ROUND(((C" & start + 2 & ")/C" & tcount + 1 & "),2)"
and then whn i do cells1(0, 1).Style.Number = 10 it doesnt give me the teh cell percentage and not even shows a percentage sign

Kindly help

Regards

Lakdawala Zaid

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Please share your complete code here to reproduce the issue. We will check it soon.

Thank You & Best Regards,

hello,

it is working fine with the newer verion the code in here

.............................................................................................................................................

Dim Workbook As New Workbook

Dim sheet1 As Worksheet = Workbook.Worksheets(0)

Dim cells As Cells = Workbook.Worksheets(0).Cells

cells(0, 1).PutValue("Responses")

cells(0, 2).PutValue("count")

cells(0, 3).PutValue("%")

cells(1, 1).PutValue("Male")

cells(1, 2).PutValue("9")

cells(1, 3).Formula = "=ROUND(((C2)/89),2)"

cells(1, 3).Style.Number = 10

HttpContext.Current.Response.ClearHeaders()

HttpContext.Current.Response.ContentType = ("application/force-download")

HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=Test.xls")

HttpContext.Current.Response.Flush()

Response.Flush()

Dim mStream As IO.MemoryStream = New IO.MemoryStream()

Workbook.Save(mStream, FileFormatType.Default)

Response.BinaryWrite(mStream.ToArray())

Response.Flush()

........................................................................................................................................................................

i ahve one question for u if i am using the same propert as

cells(1, 3).Style.Number = 10

then y it is not working in my version and for this i have to again by the newer version

Regards

Lakdawala Zaid

Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for the feedback.

As you are using a very old version of Aspose.Cells, so it might have some issues in it which we have fixed in later releases. So, you need to update your license subscription to use the latest version.

Thank You & Best Regards,