I'm using SSRS 2008 and I have a financial report. I would like the dollar amounts in my table to be in currency or number format when exported to Excel. Currently they end up being text.
I have trying a few things to see if its even possible. I removed the table header, didn't use the $ sign, and converted the field to decimal, but nothing seemed to work. The data in Excel always seems to be format as text.
Any suggestions?
Make sure you are using the Format string "C" but the export to excel is really a text rendering - it does not hold Excel specific attributes/qualities.
I found that instead of using a format function in the expression like:
=Format(myvar.value, "C")
Its better to not to use an expression and just change the Text Box Properties on that field. For example, I'd leave the field as:
=myvar.value
Then I would right click on the field, go to Text Box Properties, Number Sub Category/Tab, and select currency.
When doing this the results in Excel are a custom number format vs a text format.
Related
I need help in converting this text value exported in text format from software management tool "Apr 06, 2020" to data format.
I have tried various methods like text to columns then picked all of the possible data formats but nothing works. Can you please help or suggest any solution?
Your problem is a mismatch between your Windows Regional Settings (which Excel relies on in order to parse your date), and the date format in the exported file (which appears to be US-English).
You have several choices:
If the file exported from your management tool is a text or csv file, you can probably use Power Query to import the file. Select Transform then right click on the Date column and select Change type => Using Locale => and select Date and English-US.
You could change your regional settings to English(united states) while you do the import, then change them back.
If none of the dates get converted, you could try this formula:
=DATE(RIGHT(A1,4),MATCH(LEFT(A1,3),{"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec"},0), MID(A1,5,2))
Note that in the formula, you may need to change the commas to semicolons, or whatever your country uses to separate formula arguments
You can use below formula, Where A1 is date cell
=DATEVALUE(MID(A1,5,2)&"-"&LEFT(A1,3)&"-"&RIGHT(A1,4))
I am creating a report in Business Objects Web Intelligence, and there is a requirement to format a number in millions. For example, $4,879,987.23 would be formatted as $4.9M.
I tried both a custom number format and a conditional format, and I can get it to display like I want, but when exporting to excel, I get $4.9M in the underlying data instead of $4,879,987.23 - the business I am creating this for really wants to see $4.9M, but be able to interact with the cell in Excel as if it is $4,879,987.23.
Does anyone know if there is a way to export from webi showing a ###.#M format, but using the actual number (###,###,###.##) in Excel?
Format Cell to a Number with Custom formatting as follows:
#.#,,"M"
This will convert the following value...
4321987
... within the cell to instead be displayed as...
4.3M
You can adjust slightly to your client's preferences from here.
Do note that it will round according to regular arithemetic rules.
If you do the custom formatting AFTER the data has been imported into Excel, as opposed to prior, you will not see the real number adjusted or modified in any way.
I am not sure if there is such a thing in Excel (xlsx) file, but if you see the screenshot
I can type in certain format of value what is displayed in cell is different from formula bar.
But if I use ClosedXml to create Excel,
currentCell.Value = "1-Jan-2017";
currentCell.DataType = XLCellValues.DateTime;
The file generated by the code looks like (just see the last cell)
Is there a way I can use ClosedXml to achieve what I need? Our business person likes to see the value "1-Jan-2017".
That format seems to be number 15 from the predefined date formats in Excel (see here). You can use the following to set it
currentCell.Style.DateFormat.SetNumberFormatId(15);
For other (not predefined) formats you can also use something like
currentCell.Style.DateFormat.SetDateFormat("d-mmm-yy");
I have some fairly simple raw data where the format of column LastUsageTime is custom (yyyy-mm-dd hh:mm:ss):
And a PivotTable:
.
The LastUsageTime column is a MAX function (I simply want to display the dates, not count them). The problem is Excel doesn't understand the custom DateTime format of the raw data LastUsageTime for some reason. It puts 1900-01-00 everywhere. However, if I copy the text of LastUsageTime, paste it to NotePad, then Copy/Paste it back to Excel, it works fine!
However, the raw data is sourced from an external XML file, so when I click refresh, it gets messed up again.
How can I fix this?
I think you need to convert the raw data LastUsageTime from string to a date/time value (as Excel does for you by coercion with the copy/paste). Perhaps:
=DATEVALUE(E2)+TIMEVALUE(E2)
I am trying to OPEN .txt-file in Excel. The values should be numeric but instead are shown as dates! When manually converting "date columns" to "general" or "numeric", the number is not shown correctly.
Eg. the value should be 1.71942 -- it is shown as date 1.7.1942 --- when manually changing the format --> 15523.
This is what I found:
"If there is a recognizible date in the data, the cell will be formatted as a date in the worksheet even if the setting for the column is General. "
The question is: how to best avoid this problem and open the data in the right form? I really appreciate any advice!
According to Microsoft:
Unfortunately there is no way to turn this off. But there are ways to
get around it.
If you can change the content of the text file before opening it into Excel, there are several ways. For example, you could insert an apostrophe ' before the number. See this other post on Stack Overflow too.