Add a shape to a specific cell in Excel - excel

Is it possible to fill a cell within a range (A1:H4) with a rectangle shape so that the entire cell is filled and when the range is sorted the rectangle shape stays with the cell it was placed into?
Original range with 3 shapes added for Washington and Roosevelt
After sorting on Name column this happens:
Is it possible to tie a shape to a particular cell?
EDIT: It appears if the shape fits within the size of the cell, then it 'stays' with the cell when the range is sorted?

If you sort across multiple columns using SORT() or using data->sort on the ribbon, it will keep the rows in tact and your colors will stay where they are. For example:
=SORT(A2:AH4)
will sort those 3 rows in ID# order and keep your colors with each row as it moves.

Okay - If the shapes need to sort along with the cells, it is necessary that the shape be completely contained within the cell.

Related

How to highlight four random selections from a column?

I'm trying to randomly highlight (change the cell colour) of four cells in the first Excel column. It is important the selections highlighted are only cells containing data as the size of the data set will vary.
The highlighted selections needs to be un-highlighted when the macro is run again to generate four new selections.
I have tried to brute force this with functions (RAND-RANK-XLOOKUP), but the outcome is messy and doesn't react to different sizes of data.
Highlighting the cells in a color is the goal, conditional formatting could be suitable.
Four random cells from the first column of the Excel sheet is the target (cells only containing data).
Using Conditional Formatting
Let's say you have data in column A. For example 16 rows like this:
You could use the COUNT() function to calculate the number of cells with content in column A in cell D1 :
=COUNT(A:A)
And then you could calculate the position of the cells you want to highlight with
=RANDBETWEEN(1,$D$1)
Then you can create a helper column to check if a cell should be highlighted.
Formula in G2 : =IFERROR(MATCH(CELL("row",A2)-1,$D$2:$D$5,0)>0,FALSE)
The idea behind this function is simply to check if the row of the data point corresponds with one of the random positions we have.
Finally, you would use a formula to define your conditional formatting by applying it to Column A and using =$G2 as the formula.
Note that:
The highlighing will reset everytime you change a cell provided that you have "Automatic calculations" turned ON.
There is a possibility that 2 or more of the random positions are the same, so you'll need to recalculate if that's an issue.

Conditional Named Range for Scatterplot Data Series

I need help making a scatterplot with multiple data series using named ranges. I made up some data in the attached pic, but my data looks similar to what is shown in the attached pic, except it goes on for a thousand rows. I would like to create a scatterplot where the first series x-values (column B) and y-values (column C) are those corresponding to Type 1 (column A) only, where the second series x and y values are those corresponding to Type 2 only, and so on and so on. Basically, I need a formula for a named range that scans column A, identifies all the Type 1s, then sets the range of x-values in column B to be those corresponding to Type 1 only. Same for the range of y-values in column C. Then repeat the process for Type 2, and so on. Essentially, I need a formula for conditional named ranges. My goal is to make a scatterplot similar to that shown in the attached pic (which I did manually the cumbersome way, not using named ranges). Any help you can give me would be greatly appreciated.
Excel_Example_Data
Excel does not automatically identify series based on row data. However, assuming that know the unique values that may come for type (column A) beforehand, you may use the below workaround. First, enter the formula =B2 in cell D2. This is simply to make the range selection easier later on and can be omitted but then you will have to select the disjointed range when making the chart by using Ctrl key.
Next, in row 1 from column E onward, enter the distinct values for Type that you expect will come in the data (see cells highlighted in Yellow). This is to simulate different series of data.
Now, simply enter this formula in cell E2:
=IF($A2=E$1,$C2,NA())
and drag it down and to the right till the last row and last column. If you look at the data, this has simply added the value of Y under the appropriate type and all other types are #N/A (this is required because any other text or blank will be considered ax 0 by the graph and it will mess up the view.
Once this is done, it is easy, simply select the range from D2 till last row and last column of your data and add the scatter chart. It will give you the view you are looking for. You may then modify the series name, chart title etc. by using the chart options.

excel conditional formatting comparing different rows and columns

I'd like to change background color of cells if the value of $E2=$F1 (comparing different row and column). The range I have selected is =$E:$F.
I want the background color changed in both same value cells or at least on the first column cell. The problem is that I don't know of to tell excel to change the "1st. column, 2nd. row" of every comparison. Excel is changing only the cells of the first row and not the cells that have the same value.
Excel Sheet
Formula
I don't speak English, I hope you can understand what I am saying. :-)
Thank you!!!
Create a custom formula rule as =$E1=$F1, and apply it to the range =$E:$F.
Be careful that this will see two blank cells as equals and turn them red, so you're better off doing =$E3=$F3 applied to the range =$E3:$F12.
EDIT
Now I understand your question, just create two different rules,
=$E4=$F3 applied to range =$E4:$E12
=$E4=$F3 applied to range =$F3:$F12

How do I update the data label of a chart?

For example, I have a pie chart, 95% of it is blue.
Now I update some excel fields that have to do with the blue area of the piechart, 95% then goes down to 90%.
Now I want to also update the Data label of the blue area because it is still 95% and not 90%, instead of changing it manually, how can I make excel update the labels for me?
First, you have to build the labels via formula somewhere on a worksheet. Once you've done that, you can link the chart's labels to the cell containing the "data labels"
To build your data labels, somewhere else on your worksheet (conveniently, in the adjacent column would be ideal), use Excel formula to build the desired label string, for example: ="Blue occupies "&TEXT(B3,"0%")
Repeat for the other points in the chart.
Once you've done that, here's how you link Data Labels to a cell reference (normally, Data Labels are linked to the underlying data value).
Select the data label
Then, place your cursor in Excel's Formula Bar, and enter the formula like ='Sheet2'!$C$3.
Now, that data label is associated by the formula, to the cell C3, which contains the desired data label that we built above. Repeat as needed.
Note: The sheet name is required in this formula. Use single-quotes around the sheet name if it contains spaces.

Extract excel cell values of coloured cells

Want to copy all values of coloured cells in different sheets. Attaching the image for reference where I want to extract all values which have coloured cells Excel sheetsample
If you need this operation to be performed only once, you do not need to use vba. It would be easier to put filter on the top row (ctrl+shift+L), click the dropdown on the column and use filter by colour. Then you can easily mark all and copy/paste.

Resources