Calculate spreadsheet row height - apache-poi

With Apache POI, is there a way to calculate row height given the cell style for a "default" cell in this row?
Empirically, I found out that row height for a row filled with cells containing text in Arial 10pt is 15. However, I would prefer a more deterministic aproach to get this done, instead of building a quick'n'dirty solution.

Related

Hiding specific rows in excel without formula

Is there a way in MS Excel 2007 where I can hide a row in excel that contains a specific value? For example if cell B1 contains number 6, the entire 1st row will be hidden.
NOT with formula.
Formulae don't do that sort of thing. With formulae about the closest to your desired result might be to apply conditional formatting to 'hide' the contents of the entire 1st row - by blending their font colour into that of the text background, or 'redact' - if say black font then applying black fill.
Try VBA.

Format cell fill based on a range of values

Could anyone advise how to format the fill of cell based on percentile ranges? So for example, I have a row of values. I'd like to format the fill on those cells such that I have cell fill colour for three conditions: above the 90th, between 10th and 90th and below the 10th percentile. If I try to create a conditional formatting rule with a 3-color scale, I am not sure how to format the 10th to 90th percentile range.
So basically what I am asking is how to format a row of cells thresholding on a range.
Thanks in advance!
Using Excel 2013, might be slightly different path for older versions.
Highlight the cell range you want.
Home -> Conditional Formatting -> New Rule
Under New Rule, there should be 6 options, choose option Format only top or bottom ranked values. Choose Top, 10 (or whatever number you want), and click the box for % of the selected range.
Hit Format and go to Fill, and choose a background color.
Do the same thing, but now choose Bottom instead of Top.
This will highlight the top x% and bottom y%. Also, if you're open, you should also try Icon Sets and you can use Green/Yellow/Red circles or arrows to help.

Trendline conditional formatting

I wasn't successful in finding a solution to my question by googling it, so i hope here there are experts that can help.
I just have one set of data over time (the number of actions per date, so for one month, two columns and 30 rows). I am using a clustered column chart to visualize that data, and have placed a trendline on it.
I would like to change the color of the trendline dynamicaly, to RED if it it descending, or GREEN if ascending. That's it.
Whatever option I tried in Excel 2013, I haven't found the solution, and programmaticaly, I am too "dummy".
I have an approach that skips the built-in trendline. You calculate your own slope, intercept, and correlation, plot your own trendline(s), and use your own formula in the chart. In fact, you have two lines to go with your columns, one that appears if the slope is positive and the other if the slope is negative.
Here's how:
In the screenshot above I have your data in columns A and B. I calculate some statistics as follows:
cell G2: =SLOPE(B2:B12,ROW(B2:B12))
cell G3: =INTERCEPT(B2:B12,ROW(B2:B12))
cell G4: =CORREL(B2:B12,ROW(B2:B12))
I generate the formula in cell G6:
="Y = "&TEXT(G3,"0.0000")&" + "&TEXT(G2,"0.0000")&" * X"&CHAR(10)&"R² = "&TEXT(G4^2,"0.0000")
The superscript "²" is inserted by holding Alt while typing 0178 on the numeric keypad. "0.0000" is the format I'm using to display the cell values in the formula; without using the TEXT function, you'll get something with way too many digits to be useful.
The formulas in C2 and D2 (copied down the column as needed) are:
cell C2: =IF($G$2>0,$G$3+$G$2*ROW(),NA())
cell D2: =IF($G$2<0,$G$3+$G$2*ROW(),NA())
Because of the IF and the NA(), you get values only in one column and #N/A errors (which won't plot in a line chart) in the other, depending on slope.
Create a clustered column chart using all four columns, then change the chart type of the two trend series to line chart. Format the columns and lines as desired.
Select the title by its border, so the cursor isn't in the text of the title. Type =, then click on the cell with the formula. This link will cause the title to update if the formula changes. Change the title text size from huge to something reasonable.
Delete the legend if desired. In this case it really isn't needed.

Gradient fill conditional upon number of instances of specific text

I'm trying to use a header row for conditional formatting that shows a gradient (stronger colour of red) depending on how many occurrences of text are in the cells in each column. For example, if there are two instances of text in the column below, the top header row cell will be a lighter shade of red. If there were 20 instances of text in the column below, the top header row cell would be a darker shade of red.
Does someone have a straight forward way of making this work? I suspect it will be based on a 'count if' formula but unclear on how best to go about what I suspect will be a very straightforward operation.
If prepared to add a formula in Row1 such as:
=COUNTIF(A2:A12,"a")
copied across to suit, then a Graded Color Scale should suit:
Here the relevant text has been chosen to be a.

counting cells with font colors in excel

I need to count the number of color font occurance in a column?
In 'my column' you can see that I have used bullets and coloured them differently.
For now, I am sorting the cells by font colors and calculate the number of each color occurence manually, however, the range is very vast and I'd like to do it by using some formula.
Could you help me?
only with default formula looking at font color is not possible per kpark.
without using VBA, it's impossible per Sean Cheshire.

Resources