Drag formula a vertically and horizontally in Excel - excel

I trying to populate the formula of distance between two points-shown in the image below-I want to be able to type the equation in one cell and drag it vertically and horizontally to populate the matrix. I tried to $, but it didn't give the desired results. Please see the image below as an illustration; it's an example. Thank you in advance.

Excel doesn't understand the reference to x1 and x2. What you need to do first is type in the topmost cell coordinates like so:
sqrt((D6-H6)^2+(E6-I6)^2)
Then drag down from the corner of the cell containing the formula and Excel should extrapolate the forumla for you to populate the rest of the cells. Also, you can also simply click on the cells to insert them into the formula instead of typing them in.
As you drag down, Excel should automatically repeat the formula by incrementing the row number by one for each row you drag the cursor to:
sqrt((D7-H7)^2+(E7-I7)^2)
sqrt((D8-H8)^2+(E8-I8)^2)
sqrt((D9-H9)^2+(E9-I9)^2)
...
EDIT
If you're doing matrix multiplication, this may not work smoothly for you. Try giving this a read:
http://spu.fem.uniag.sk/cvicenia/ksov/hanova/Econometrics%20I/matrices2.pdf

Related

F4 on Excel ranges, is it possible?

I have an Excel file with two worksheets.
In worksheet 1, I have an Excel table with three columns.
In worksheet 2, I want to perform some calculations on the Excel table.
Now, in F5, the formula is =NB.SI(mytab[col1];F4).
Now I want to duplicate the formula on the cells from left to right, by clicking on the + sign
in the bottom right corner of F5 and "spreading" it from left to right.
The actual result is that the range mytab[col1] is changing to the others range (mytab[col2],mytab[col3],..)
To obtain the desired result, I had to copy and paste the formula so mytab[col1] can't change.
Is there a way to lock the range by F4 ?
Actually this is a reduced example, in real world I have about 27 values rather than 5.
Many thanks in advance.
For a table range, you can make ranges absolute like this: =NB.SI(mytab[[col2]:[col2]])
The images you posted aren't much good - the 2nd one doesn't show the formula.
If you want to make the reference to col1 from mytab absolute, i.e. it won't change as you drag the formula across you can use mytab[#col1:col1].
=NB.SI(mytab[#col1:col1];F4)

Excel 2016 Scatter Plot - wrong position on x-axis if cell with formula is blanc

I am trying to chart in Excel a table that is built conditionally.
The table on the left comes from the table form the right and leaves cells blank if the corresponding ones on the other tables aren't numbers.
However, if I try to extend the range, in order to include the cells that have a formula but are blank, the x-axis behaves in a bizarre way and the x values will be 1,2,3 instead of the given ones.
I guess it doesn't consider numeric values any more as numbers and just orders the items on the x-axis.
What can I do to make it work properly?
Thank you!
If you don't mind showing a dot at 0,0 then this works. If your reference data are not numbers, then use 0....
Cell C3 formula: =IF(ISNUMBER(F3),F3,0)
Drag it where needed.
Output:
Instead of returning an empty string in your formula, return a NA value
Formula: =IF(ISNUMBER(E6);E6;NA())
If you need to hide those values, use conditional format (see this)
Let me know if it works

Excel Conditional Formatting Rows with Formula unique to each row

Photo of Spreadsheet
What I'm basically trying to do is have the cell E15 turn red when the percentage in J15 is less than or greater to 20%, and the cell K15 has the text: Plate.
I also want this effect to happen with all the cells in E15-E34, but for them to be based on their individual row. So, for example, E18 would turn red when K18 says: Plate and J18 is less than or greater to 20%. I don't know if I'm just going about this the wrong way, but if not, then how can I achieve what I need to?
I've tried removing the $ but they automatically reappear, any help would be greatly appreciated. See conditional formatting formula below. Photo of spreadsheet at beginning of text.
=AND(K15="Plate",J15>=20)
Column K is a selection of either Plate or Stiffener and Column J is a percentage based off a calculation of another cell.
In my above photo, I have setup a conditional format with two actions (ignore my values in the photo, and follow these steps).
First, Select Cell K15 to K19 (it is important to start at K15, or else you will have to modify the formula below).
Next, add a Conditional Format formula (below). Any cell reference within this formula MUST be relative to the K15 cell.
=IF($K15="Plate", AND($K15="Plate",$J15>=0.2), AND($K15="Stiffener", $J15>=0.25))
You could also use this bit of code which is much more flexible, as you can expand the number of items.
=OR(AND($K15="Plate", $J15>=0.2), AND($K15="Stiffener", $J15>=0.25))

Get value of columns in Excel

Here i got a table in Excel. But how can I make these columns calculate in the 4th column the average from the ABC colums in front of it? I know how I can do it manually: AVERAGE(A1:A3) per column but that takes way too long.. Someone know a shortcut?
The correct formula to measure averages for the 3 columns to a cell's left is AVERAGE(A1:C1). Beneficially, we don't have to enter it for each row. Instead, enter it once in row 1. Next, if you hover your mouse over the lower right corner of the cell, the mouse cursor will turn into a small icon that looks like a t. Once this happens, click and drag the formula down as far as you'd like.

Excel 2010: Counting cells with adjacent cell blank

I have data in rows where each column represents a day, some of which are blank and some of which have numbers. I want to "scan" down the row, comparing each cell with the one before to the left of it (or the one 2 spaces left of it, etc). For example, I want to sum the number of cells (days) with a blank in the cell before it. Or, I want to sum the number of cells that are greater than the cell to the left of it. I can't figure out how to dynamically compare to the prior column using addresses that change with each cell.
This is from what I understood from your Question:
If you refer to the screenshot below, you want to count Columns B to H if the column has a number and the column to the left is blank.
So, if this was just one column, we would write the formula as:
=COUNTIFS(B3,">0",A3,"")
Now since you want to do this for a range of columns (an array of cells), you need to do something like:
=COUNTIFS(B3:H3,">0",A3:G3,"")
and accept with a Ctrl + Shift + Enter.
So the formula would be displayed as:
{=COUNTIFS(B3:H3,">0",A3:G3,"")}
Array formulas are perfect for this task. I can't give you a lecture on the topic but you should read on it. Basically, you can select multiple cells in a range and act as if it was one cell.
For example, you could do something like this:
=SUM(IF($A$1:$A$100="", 1, 0))
When you enter array formulas, be sure to hit CTRL + SHIFT + ENTER in the formula box to signify that you want Excel to treat this formula as an array formula. Otherwise you will not get the expected results.
Using this method you can do any kind of comparison. Sometimes it helps to see how Excel treats the formula. You can select part of the formula in the formula editor and hit F9 to see what this segment computes to according to Excel.

Resources