I have a chart based on a table.
The data in the table is conditionally formatted to be either a number or currency.
When formatted as a plain number the Y axis looks like the following:
When formatted as currency the Y axis does not adopt the same formatting. Is this deliberate or a bug in Excel? Is there a workaround? I don't want to use VBA in the solution but any sort of formula is of course fine.
Edit - Actual Solution:
The solution to this tricky thing was to use named ranges!
A named range can switch his content, thereby redirecting a chart dynamically based on a condition! This is quite powerful. I used it on other occasions, but I had to first get really obsessed with this question, so that my memory was triggered.
In my screenshot you see all contents to solve this. Just set up those two names with a condition you like.
Unfortunately my solution requires to dublicate your data-columns in order to reflect the different formattings. But at least, it solves your problem.
Edit:
After looking into this problem more detailed, I must mark here, that my answer does not solves this particular problem. While this can be used in combination with a VBA-Solution for the given problem, it cannot be applied without VBA, except of course for static formatted data.
This is possible with the right settings for your axis:
When you link to source, the formatting of your data will be reflected in your diagram ;)
Otherwise your chart will use whatever format you have set for this axis.
Conditional formatting does not apply to any graphs, it shows only in the tables in your sheet. It is more of a layer than actual data source.
Use standard currency formatting or you can use a formula like =a1&" £" if you need to do some extra data formatting
Here is a link that may help you. You can do it using Named Ranges and Offset. That is the best I could find after a little searching.
Related
Despite looking at a similar topic I have not been able to solve this yet. I want to create a vertical line that automatically updates with week number in my sheet (not chart). See picture.
Somehow, I can not solve it with conditional formatting. Can you help me with what/how to make the formatting or (preferably) using a macro.
I have illustrated how I want it to look using an inserted figure.
Hope someone can help.
The formatting takes me to here:
.
However, the layout/visual is not super good as it over writes what is already in there.
Conditional formatting is a good way to solve this though. Let's say my week numbers are on A1:ZZ1, then using below formula and applying it to the entire table could give you what you want?
=A$1=WEEKNUM(TODAY())
This seems to be so simple of a request, but I was not able to find an answer. I have a numeric cell and it seems to round numbers. Can I ask excel to tell me formatting settings of a particular cell. For example if the number formatting is fraction up to one digit I would like to know that. It would also be nice to know what the other attributes are; like width, centering, and so on.
You can get some information using the cell function (doc), but it's not as useful as one hopes...
You need to use VBA for more details.
In the formula bar the data shows up as 69.849999999 and in the cell as 69.85. I am trying to get that number in the formula bar as 69.85. I tried Copy and Paste Values and almost everything else that I can think of. Even formatting the cell as a number with only two decimal places. Nothing is working.
Any ideas?
The following will radically change your data so use it with caution; possibly even on a backup copy until you are sure this is what you want.
If you have all of the numbers formatted the way you want (e.g. 0.00) then go into Excel Options (Alt+F,T). Choose Advanced from the list down the left and scroll the right pane down ¾ of the way to the When calculating this workbook section.
Click Set precision as displayed. Acknowledge the warning.
Remember to also click OK in the lower right to accept the option change and close Excel Options. All of the numeric values within your workbook will be rounded off to their displayed value of their number format. Note that numbers set to a General should not be affected.
Use at your own risk. I'm not saying this is a bad thing; just that you should be completely aware of the consequences before you commit large amounts of data to this option. See Change formula recalculation, iteration, or precision for more information.
Try:
=ROUND(A1,2)
then select, Copy, Paste Special, Values.
mrmcg,
=TEXT(A1,"0.00") is my preferred method here.
In hopes to be helpful it is a good idea to understand what you need to change to get the correct result. When you change the formatting (i.e. number, decimal, general) you are only changing the way the data appears, not the actual data.
You will need to use a formula like round, floor, text to change the actual data.
good luck and I hope that this is helpful!
I'm pretty new to Excel, and one of my bosses (who knows even less about Excel than I) is asking me to create a spreadsheet that will track a bunch of different deadlines. For quick reference, I need to use conditional formatting to do the following:
Highlight only non-blank cells that contain a date in the past.
Highlight with a color scale cells containing dates between now and now+90 workdays.
Nothing I've tried is giving me the results I need. I'd appreciate any guidance, as I'm getting very frustrated and this is fairly time-sensitive.
I will answer your second question. I think you will be able to answer the first one yourself from what you learn from the second one.
The executive summary is: use a combination of TODAY() and WORKDAY().
Now for some useful detail.
First, I suspect (from your reputation) that you are new to StackOverflow. Welcome! Take a look on the right side of this page. At the bottom there are "Related" questions. I obtained the following one from there. It is half of the answer to your question. The key point is to use the TODAY() function in your formula.
Second, the WORKDAY() function, with a positive number n, provides a date n workdays into the future. You may also need to make adjustments if your company's calendar is different from the canonical one.
You may want to set a cell in your spreadsheet to the date returned by =WORKDAY(TODAY(),90). Lets just pick A1 for simplicity of explanation. When you first add that formula, you will get what seems like a nonsensical number. Change that cell's format to date and it will make sense.
Now you can refer to A1 in your conditional formatting, as in the "less than" highlighting rule. That should do it.
P.S., while you are at it, search for "named ranges". As a beginner, it is probably the most useful "trick" you could learn. Then name whatever your A1 cell turns out to be something meaningful, like ninetyWorkdaysAhead (you cannot start a named range with a number), then refer to that name in your rule. That way, if you need to move it, your code will not break.
I have read answers here to the question of sorting in Excel and having formulas not working. But the answers do not seem to help in my particular case.
I am a soapmaker and use Excel to calculate my recipes. The oils are listed alphabetically. I plug in the amount of oil I want to use.
I have formulas at the bottom of the spreadsheet to determine the ratio of solid oils to liquid and the ratio of some of the other oil combos.
Once I have the recipe I want to use, I want to sort the oils by quantity so that I can more easily make my labels, listing ingredients in order of amount used.
When I sort, the formulas at the bottom get all messed up. Putting $ in the formulas for the cell references does not help. I'm fairly Excel-savvy and that was the first thing I thought of.
I suppose could name the cells, but I have so many oils listed (30+) that that's prohibitive and I may add more in the future.
The calculations I want are quite simple yet I've tried all the methods I can think of and it's still not working. Help!
There are a number of solutions that could work, but as you've seen keeping static formulas below data you are sorting, is not usually going to work well. Here's something to consider:
If you can, ALWAYS group related data and formulas in a SINGLE ROW. This means for example, moving your formulas to the end of each row so they move around when the data moves around in sorting. Most people go wrong by trying to make it look pretty - but this is the most organized. Go for what's functional.
Your other alternative is to use Excel 2007+ tables (google search) - but I suspect from your description that you're pointing to specific rows and those can't be tracked without using VLookup. So that's your other alternative - Vlookup (google search - dozens of examples out there). You're basically writing a formula to dynamically find the correct row, no matter where it is (landed after sorting)
I really recommend my first option though, keep your formulas in the same rows. Hope that helps!
Move your data TO ABOVE the sort area. I do this when I have subtotals and other row based calculations, so that when I sort I don't have any issues.
I also suggest moving your label functions to a rank formula and use an Array formula to look up the unique combination, along with the Congatenate functions, so you don't have to worry about sort functions in your sheet.