We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

RAND() and RANDBETWEEN() not working

dear aspose.cells support,

I have a spreadsheet with multiple cells that are populated with random values ( excel function RAND() and RANDBETWEEN().

When importing the sheet using aspose.cells, the values of all random cells are the same - I believe they should all have different values.

Please advise - or is it me being stupid ?




Could you give us your template Excel file(s) with sample code (or prefrably a sample console application, you may zip it prior attaching here) here to show the issue, we will check your issue soon.

Also, please use our latest version/fix e.g v7.4.2.x if you are not using is already.

Thank you.


Thanks for your posting and using Aspose.Cells.

We were unable to replicate this issue as per your instructions. We took a file with random values using Rand() and RandBetween() method. All values were different and none of them were same. Please see the following code


string filePath = @“F:\Shak-Data-RW\Downloads\rand.xlsx”;

Workbook book = new Workbook(filePath);


book.Save(filePath + “out.xlsx”);

I have tried it and it does not seem to work.

Please find the source xlsx file and the resulting pdf file
I am using rev 7.4.2

If I save the file in the excel format, then the formula remains and the random numbers are there.

The problem occurs when you save the sheet in a pdf format, then all random numbers are the same.
The same issue appears when saving to html.

Dim wb As Aspose.Cells.Workbook
wb = New Aspose.Cells.Workbook(“F:\MWORKS_REPORTS\energie.xlsx”)
wb.Save(“F:\energie.pdf”, SaveFormat.Pdf)


Thanks for your posting and using Aspose.Cells for .Net

Please provide your source xls file which you are converting to pdf in a zip file. The .7z file which we received earlier was unable to open at our end. Please provide these files in a zip file or winrar archive.

i am using 7zip. another try


Thanks for your posting and using Aspose.Cells for .NET.

Thanks for providing the file, we have found the same problem. The random numbers are not converting properly. All of them are showing the same value. We have logged this issue in our database. We will look into it and fix it. Once the issue is resolved or we have some other update for you, we will let you know asap.

We have also attached the output pdf for your reference.

This issue has been logged as CELLSNET-41588


Thanks for your posting and using Aspose.Cells for .NET.

We have fixed the issue.

Please download and try this fix: Aspose.Cells for .NET v7.4.2.5 and let us know your feedback.

thanks for the update and your super fast reply.

Yes the data is n ow different. However, it can hardly be called random.
Everytime you open the spreadsheet and recalculate the sheet, the RAND() function returns exactly the same random data.

Also, within one spreadsheet, the random value are not random at all since a fixed number seems to be added everytime to the ¨previous random number.

Attached you find a resulting report with a sheet with some random values - not really random…

So this does not really resolve the problem.

Thanks for your feedback.

We have notice this issue, after taking two pdf output both have same output of random data. We will look into this issue. We have also attached pdf outputs for your reference. We have logged your comment in our database. Once we have any update for you. We will share it with you asap.<span style="font-size:12.0pt;line-height:115%;font-family:"Times New Roman","serif";

mso-fareast-font-family:“Times New Roman”">

The issues you have found earlier (filed as CELLSNET-41588) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.

resolved !!

thanks for ypour great support.


Good to know that your issue is resolved by the new version of the product i.e. Aspose.Cells for .NET v7.4.3.

Feel free to contact us any time if you need further help or have some other issue, we will be happy to assist you here.

Thank you.