I filled an Excel table via QXlsx (available on GitHub) with numbers that should in any case be treated as strings. In Excel the affected cells show a green triangle which says that the content is actually a number.
In Excel I found an option which suppresses the warnings. But I am searching for a solution within QXlsx. Thanks for your support.
Related
I am trying to display the outcome scores on one Excel sheet into another Excel sheet based on the outcome name and course.
If the text in Sheet1!C2=communication and Sheet1!E2=Comm 2010, then display Sheet1!D2 on Sheet2!B3.
If the text in Sheet1!C4=information* and Sheet1!E4=Commm 3000, then display Sheet1!1D4 on Sheet2!C5.
Need to be able to use Wildcard when checking the text.
If the text in Sheet1!C6=communication and Sheet1!E6=Comm2010, but there is no number in Sheet1!D6, leave Sheet2!B5 blank
I have played around with a few different IF AND formulas, but I can't get the data displayed correctly.
Right now, I am building a pivot table from the data in Sheet1, then taking the table and formatting it to match the table on Sheet1 then using =IF(Pivot!C7="","",Pivot!C7). This works, but building a pivot table for each student and then formatting it to match Sheet1 is a time drain.
I'm really hoping there is a better way to do this.
Thank you!
Since you are compiling outcomes on a per-student basis and not in total it is safe to use the SUMPRODUCT() function:
The formula below is used in B3
=SUMPRODUCT((Sheet1!$E$2:$E$6=Sheet2!B$1)*(Sheet1!$C$2:$C$6=Sheet2!$A3)*(Sheet1!$D$2:$D$6))
and can be copied across and down throughout B3:C4
The formula used in B5 is different, because of the 'wildcard criterion'
=SUMPRODUCT((Sheet1!$E$2:$E$6=Sheet2!B$1)*(LEFT(Sheet1!$C$2:$C$6,11)="Information")*(Sheet1!$D$2:$D$6))
(unless you are using Microsoft 365, having the formula directly suppress 0 values essentially entails doubling it in length so, as an alternative, given the small output range, a custom-number format has been implemented, which effectively doesn't display 0 in a cell where that is the formula result)
In my document, I need to generate a table that has merged cells.
simple example
As M2Doc does not support the merge of cells, I have tried two workarounds.
Workaround 1
It consists in creating nested tables inside the second column. I have played with the borders to hide the fact that it is a nested table.
M2Doc template of workaround 1
Unfortunately Word does not handle nested table correctly, as there is no way to garantee the constant width of cells. Which results in columns that don't have a constant width.
illustration of inconsistent column width
Workaround 2
My second workaround was to generate excel tables outside M2Doc, with Python4Capella. And in my M2Doc template, I create references towards the generated tables.
This second workaround would work well if I did not have to display XHTML descriptions in my table. So far, I can only get the markup code in Excel and I have no means to interpret it.
Any idea of how I could implement my table including merged cells with the current capabilities of M2Doc? For example with a dedicated Java service that I would develop? If so, any hint about how this service could be implemented is highly welcome. And so is any idea of strategy!
Thank you
It is possible to create a Java service to merge cells for instance this service.
Also you have Excel services to insert a table from an .xlsx file.
With Python for capella you will have to parse the XHTML from your description to use OpenPyXL formating.
And maybe an other idea could be to use MS Excel itself to do the conversion via a macro or some cell format option.
I have a PowerBI report built in PowerBI desktop and displaying in a .net app using javascript. We have basic cards with decimal values formatted as currencies or percentages (in the formatting ribbon in PowerBI desktop). When the embedded report first displays in the web app, the formatting symbols ($, %) show for a split second and then disappear. I've removed layout and any extra style sheets and javascripts from the page, but still get the behavior. Have also set the localSettings in the JS config. Any ideas?
It's not a great solution, but a potential workaround would be to format the values using the FORMAT function which changes them to be text strings in the format you define rather than numeric values that get formatted however it decides.
For example, if you have a [measure] you can define another one like this:
measure_formatted = FORMAT ( [measure], "$ #,0.00")
I use SAS EG 6.1 to add sheets to an existing excel file (xlsx). I use a simple proc export with DBMS=xlsx. The data is written to the excelfile succesfully.
However it appears that formatting in Excel is taken from the already existing sheets. There also is a difference between cells that contains numbers vs. cells that contain text. For instance when in the existing sheet i used header 1 cell style, the numbers in the exported worksheets also had this header 1 style.
Screenshot of the existing sheet: Existing Worksheet
Screenshot of the added sheet (wrong formats)
The wrongly formatted added worksheet
I tried the following things:
- add an extra sheet without formatting and place this as first sheet in the workbook. My thought was the exported work sheets then wouldn't have the format either. No succes.
- add an extra sheet without formatting and place this as last sheet in the workbook. My thought was the exported work sheets then wouldn't have the format either. No succes.
2 alternative possible solutions i think of are:
1) using the pcfiles and ranges method. I will try this and post the results.
2) recreate the existing workbook and pray to see different results.
Did anyone have this experience and solved this problem?
update 17-1-2016: added screenshots and tried the procedure with a fresh excel workfile. The latter didn't result in succes.
I'm trying to tidy up a sheet with the following problem, and would appreciate any advice.
My sheet has 7 "master columns" and about 4000 rows. It was compiled by converting a load of PDF documents.
The master columns are made up of merged minor columns, but at various parts of the data, the minor columns that make up each master column are different.
eg The first master column is made up of merged columns A-H for the first 30 rows, but for the next 25 rows it's made up of merged columns A-G etc.
As I said, overall there are still the same 7 master columns from top to bottom, but the merging is different throughout...
Can anyone think of a way to fix this without doing it all manually?
Copy your horrible spreadsheet into Word with Home > Clipboard – Paste, Paste Special, Unformatted Text and replace ^t^t with ^t. Replace All repeatedly, until Word has completed its search of the document and has made 0 replacements. Copy back in to Excel.
This is not tested on your image so there might be some issues – perhaps column misalignments (where even Word’s limited regex may help to add back tabs where suitable). The result should be no merged cells – mind you someone on SE described these along the lines of “A creation of the Devil to test us beyond endurance” (ie best avoided).
Try selecting the full document and click unmerge button from the ribbon.
As per the screen shot you provided, you can select all and unmerge but getting the corresponding fields in order might be challenging.
Try using macros to set combined functionalities in a single or combine key presses