Ask Your Question
0

How to add markup inside a conditional query ?

asked 2018-10-07 14:20:34 +0100

plop gravatar image

Hi,

I have 2 columns in my sheet, and to save on white space when printing I decided to merge them togheter and play with the markup factor .

minimalistic example of my situation with random ages and names, not everyone has a specified age like so :

...
12 Jon
   Dean
   Phill
45 Megan
   Portia
...

The formula for the new column is simple =IF(ISBLANK(A1),B1,B1&" "&A1) .

Now the problem is : how I can formulate the conditional such that when mergin the content of A in B, the content of A gets different formatting, like for example, B keeps being a plain regular font and A is italic .

I haven't found any reference to this kind of operations inside the libreoffice documentation .

I would also like to know how to make the result of a formula "permanent" so that I can delete the old columns from the sheet .

Thanks .

edit retag flag offensive close merge delete

Comments

Of course, everybody has different requirements, but why? The spreadsheets' very purpose is to contain and operate upon structured data (for which purposes, columns and rows serve) - so why try to defeat the purpose and mix data of different nature into one column?

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-07 15:03:39 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2018-10-07 14:23:55 +0100

updated 2018-10-07 14:28:32 +0100

It's impossible to create a spreadsheet formula that has its output's parts formatted differently in a single cell. You would need a dedicated macro for such kind of job.

To make results permanent, you need to use DataCalculateFormula To Value.

edit flag offensive delete link more

Comments

how to do that ? I'm ignorant and a beginner on this

plop gravatar imageplop ( 2018-10-07 14:24:48 +0100 )edit

For a hint about formatting part of a cell, see https://forum.openoffice.org/en/forum/viewtopic.php?f=20&t=47512. For your case, you would need to create a whole macro that would first compose the cell's content based on A and B columns (so it will write to destination a string, not a formula), and then format it.

Mike Kaganski gravatar imageMike Kaganski ( 2018-10-07 14:53:22 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-10-07 14:20:34 +0100

Seen: 27 times

Last updated: Oct 07 '18