Conditional Named Range for Scatterplot Data Series - excel

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.

Related

How do I reference the three largest values in a column and their corresponding text in the column next to it?

I am building an excel sheet that returns the three highest values from a column in another sheet (sheet2, column B) along with their corresponding company (sheet2, column a). Ultimately, in sheet 1, I want to have a table that will display the company with those values.
This is what I am trying to achieve:
AWS ($280.9m), Google ($241.9m), Meta ($168.7m)
I was trying to use the large formula, but this does not help me with referencing the corresponding company so I’m unsure how to return both.
You can use LARGE to get your top-n, and then wrap with INDEX/MATCH and OFFSET to get the company name.
Cell E3 formula:
=LARGE($B$2:$B$7,ROW(E1))
Cell D3 formula, which returns the column to the left of the Large value:
=OFFSET(INDEX($B$2:$B$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0)),,-1)
or remove offset and use....
=INDEX($A$2:$A$7,MATCH(LARGE($B$2:$B$7,ROW(D1)),$B$2:$B$7,0))
Drag down your formulas as far as you would like.
The above solution is good but kinda oldschool. I would use =SORT() function instead:
=INDEX(SORT(A46:B56;2;-1);{1;2;3})
Translation to human language:
=INDEX(SORT(MyArray;ColumnToSortBy;Descending);{get first three rows}, [column])
*note: depending on your windows settings your Array row separator may differ. The easiest way to check your it is to select any range with more than one row, then get to formula bar and click F9 to see result preview.
where [column] is an optional argument, by default it takes 1st column.

Excel: Extract data from well beneath unique identifier

I have a spreadsheet full of data (simplified example below) that I would like to extract the number in the well underneath of "Gimme the number" and paste it into a new column on a separate sheet (i.e. if "Gimme the number" is in G6, I would like to retrieve the value for G7). I do not have access to Excel VBA and have not used macros in the past. I found some examples linked below, but, from what I understand, they would return "Gimme the number", or "Gimme" not 19, 20, and 21. I am not sure if a pivot table is appropriate, because I only want information from a single column. I will only have up to 11 values to extract at any given time, so I think a formula would do it. I am just having a hard time coming up with one that works. Any help would be greatly appreciated!
Search for a text string and return multiple adjacent values
Return multiple matches with wildcard vlookup
I am not sure I get the question well, but I try.
First add a column right of the column with "Gimme..." values. Name it e.g. "Next_value" in the first row. Put in the formula referencing previous column next row. If "Gimme..." is in the cell (for instance) E6, than your formula in the cell F6 is =E7. Copy that formula into the whole Next_value column.
Than select area of these two columns (Label, Next_value) and apply the filter from the Data toolbar. Use the small buttons with triangles at the top of the column Label to adjust the filter so only "Gimme..." rows are filtered.
Now, copy values of Next_value column where you like. If you want just the references, use Paste special function from the Home toolbar and click Paste link button.

Select all data in Excel by column name, omitting empty cells

The goal is to create a series of graphs that will update automatically based on the raw data.
So, I have created a graph manually and want to edit the formula to accomplish the auto update.
The column names will always be the same, so I want to be able to select all data in a column based on the name BUT ignore any cell that is blank (above zero maybe).
The formula excel has given me so far is
=SERIES(rawdata!$M$1:$M$6,rawdata!$A$2:$A$37,rawdata!$M$2:$M$37,1)
So, something like
=SERIES(rawdata![column name],rawdata![column name],rawdata![column name],1)
I'm not sure how the skipping blank columns should work either. To expand on this further only one of the columns can potentially contain blank values. So if a cell is blank in that column then that entire row shouldn't be plotted, if that makes sense!
strong text =OFFSET(Sheet1!$B$2,0,0,COUNTA(Sheet1!$B:$B) - 1)
Try this formula when you define the name for the column of values you would like to have data automatically added from. I know it works when each cell has either a formula or a value. Like a column that is automatically calculated based on values in other columns.
In this formula example the cell B2 refers to the first point of data in the column. (make sure your references are absolute! ie, use $B$2)
This automatically returns the range of data as it changes when CountA is added:
=OFFSET(reference, rows, cols, [height], [width])
=COUNTA(value1, [value2], ...)
Hope this helps! It worked for me! :) If you have completely blank cells in the column you might have to make a couple changes though.
-Reverus

Multiple rows Color Scale

I have two columns, F and H. The data is between F2-F75 and H2-H75. F has the required stock level. H says how much stock is needed.
I would like to make a Conditional Formatting rule for every row in column H that formats the cell with a colour to show how much stock is required, by looking at the corresponding cell in column F. This works fine for a single row, but I have 75 rows, and manually creating a new rule for each row will take a long time. I have tried using the format painter which works for changing which cell the rule applies to, but it does not change the maximum cell to the respective one, it keeps it as is from the original formula. I have tried setting the maximum to:
=$F$2:$F$75
but this returns the error:
This type of reference cannot be used in a Conditional Formatting formula. Change the reference to a single cell, or use the reference with a worksheet function, such as =SUM(A1:E5).
This works fine for H2-F2, but I would like to have it for H2-H75 and F2-F75:
Is there another way of doing this?

Create 100+ Named ranges based on formula in cells

been looking for quite a while now, due lack of distinctive terminology couldn't find any solution, so maybe the experts out here can help.
So I got this table of 300+ collumns that are populated like this
row 1 Header/Name.
row 2 Range formula ment to be in the "Refers to" input area when a "New Name" for a range is created.
row 3/22 The information used in the range formula.
To use the range formula's in a data validation on another sheet I need to Name these ranges. If I manually enter a "New Name" I can copy the range formula from row 2 into the "refers to" input area, only with 300 columns that would be a long day of labor. That's when I found out about the CRTL+SHIFT+F3 combo which makes it possible to create a lot of named ranges at once based on a header/name and selection. Unfortunately this uses the location of selection as the source and in my case it should be the formula inside the locations's cell which would have to be the source...
So is there a way to use the "Create Names From Selection" tool that uses a formula inside a cell as the source instead of the location?
here's an image to help describe the problem
You should be able to solve this problem with 1 named range for every validation (plus 2 additional to make the formula less complicated).
The first named range (all_headers) should be defined as:
=OFFSET('C'!$A$1,0,0,1,COUNTA('C'!$1:$1))
It returns a range with the headers (product names or codes) from the C sheet. We assume that the first column is A and there are no empty columns between them.
Next we need to choose the right column. Here it gets a little tricky. In the row where you want to validate colors, you need to have exactly the same product name or code that is used in the C sheet headers. If this information is in cell A2, you should:
select the cell in the same row and in the column where the color validation is supposed to be (for example B2)
define new named range col_header with the following formula:
=INDEX(all_headers,1,MATCH(A2,all_headers,0))
The above dynamic named range is relative, that's why selecting the proper cell before defining it is very important.
The last step is to define named range val_list with reference to the list of colors from the chosen column:
=OFFSET(col_header,2,0,COUNTA(OFFSET(col_header,2,0,50,1)),1)
You mentioned that the second row does not contain data, that's why there is 2 parameter twice in the formula. If you remove it, use 1 instead. 50 is the maximum number of colors - you can adjust it.
Now you can use val_list for validation in any cell. It should give you the right list if the cell on the left contains a valid product name/code from the C sheet header.

Resources