I have two excel documents one is for data and the other one is linked to data excel.
Linked excel looks like this;
='C:[data.xlsm]Operations'!A100
='C:[data.xlsm]Operations'!A103
='C:[data.xlsm]Operations'!A106
='C:[data.xlsm]Operations'!A109
In theory if I hover the cursor on my cells and use autofill (lower right corner) it should increase by "3" as pattern but it increases by "1".
How can I make it increase by "3"?
Thanks in advence
This is a bit of a shot in the dark, so it will need some adjustment to work from your side. Use the function OFFSET and ROW together with some multiplication to get the result you want. Something like this:
=OFFSET('C:[data.xlsm]Operations'!A100, (ROW()+1)*3)
The ROW() will give you the row number for the current line. Multiply it with 3 to get the next step. The +1 is to correct for your offset and you must pick the correct value there to get it right in your case.
Related
I have a table of total 12 columns and 30 rows. The table looks like below. Note that real data are very different than this, but follows this pattern - the value goes upto some number and keeps repeating for all rows.
Data
I want to plot a line chart that looks like this-
But I am getting this-
I am able to get an expected chart by manually deleting repeating values from the table. I am looking for a way to do that automatically.
Assuming your data is arranged like this:
You could create another table referring to the first one with these formulas:
So basically, this formula =IF(B3-B2=0,NA(),B3) in H4 copy-pasted in all cells but the first row.
Which would give:
And plotting this second table would give you the desired result since NAs aren't plotted (as mentionned by Solar Mike).
Caveat
This works only if the values are stricly increasing or decreasing for every row. If there is no change between 2 data points before the end of the series where it flattens for good, then there would be missing point in your line.
For example, if 2020.Q2 started with two zeroes in a row, you would have a NA appearing before you want it.
So, you would still need to manually replace those NAs.
But if you want to automate the whole process, you could add another table that checks if there is non-NA values after a NA and if there is change it back to the previous number.
Something like this:
In this solution, the formula in O3 would have to be : =IF(AND(ISNA(I3),PRODUCT(IF(NOT(ISNA(I4:I$8)),0,1))=0),I2,I3)
Explanation:
I4:I$8 is the range of values after the current cell. We use the $ so that the range is anchored to the last row.
IF(NOT(ISNA(I4:I$8)),0,1) returns an array filled with 0's where there is a non-NA value and 1's when the value is NA.
PRODUCT(IF(NOT(ISNA(I4:I$8)),0,1))=0 checks if the product of the elements in the array is 0. Since only one zero is needed for the value of the product to be zero, this essentially checks if there's at least one non-NA value after the current one.
EDIT: If it's impossible for a series in your dataset to reach its maximum before the end, then the solution you found is way simpler. However, the method I'm suggesting is more general since it works whether the series flattens at its maximum, minimum or anywhere in between.
Replace the zeroes.
Use na()
As that is not plotted.
See:
Added benefit: if overlap is set to 100% on the blue series then it looks like the value is "highlighted" in the first series - when discussing data it is a neat way to focus attention.
Edit, this works whether the preceeding values increase or decrease:
So to solve my problem, I created one more table and applied the formula =IF(MAX(B$1:B$8)=H1,NA(),B2). This formula computes the maximum value of the source table column and compares it with the upper immediate value. New table looks like this-
Range of this table is from G1:K8
1-Select a column (or columns) to look for duplicated data.
2-Open the Data tab at the top of the ribbon.
3-Find the Data Tools menu, and click Remove Duplicates.
4-Press the OK button
Is this that you want?
I've found similar examples through searching but I can't find anything that matches the issue that I have...
I have a table which shows parts received/rejected, I wish to see the maximum days early/late (I'll only need help with one as the other I can then do!)
- but there are dummy orders which I wish to ignore (they show a received/reject of 0).
Here is example data from the 'AnnualDump' sheet:
My current calculation is
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(AnnualDump!$G:$G))
[Column H is Received/Rejected and G is VarianceDays]
This simply looks at if there is any data on the sheet before running the calculation, which is fantastic for 95% of the time... but I want to ignore any values that have a received/rejected of 0...
I want it to show 29, but it's showing 30 in this instance as it's not ignoring 0qty lines.
I've tried adding another IF statement but it didn't work :/
Completely stuck now and not sure what the next step to try is...
I can do it if I cheat (call both columns to another sheet, turn text white, use an 'IF cell greater than x, then value' to compare the whole lot and then min/max that third column) but I'm trying to avoid that!
Any pointers or help will be greatly appreciated (complete VBA noob in excel so I'd like to avoid that if possible).
Thanks
Try this array formula. Confirm with Ctrl, Shift and Enter and curly brackets will appear round the formula.
I would strongly suggest you don't use full column references though as these formulae are rather resource-intensive.
=IF(ISBLANK(AnnualDump!$H$2),"BLANK",0-MIN(IF(AnnualDump!$H:$H>0,AnnualDump!$G:$G)))
I've a question regarding columns and finding non zero values with there labels.
Hopefully the pictures will make my problem/struggle a bit better to understand.
Basically, there are columns to the right that show labels and hours that a team loaned in or out.
The values are found through a formula that shows per label the totals amount of hours spent.
Now I want to have on my overview page the two columns to the right with only labels showing the labels that contain hours. I've tried to use multiple if variables but that didn't seem to work :(
So at the end it should show something like this (I now manually typed the labels and data):
I did a quick recreation of your data structure to test this.
Using Array Formulas should get you the desired results in the current structure of your worksheet:
For range Loaned in you'd need the formula to be
=IFERROR(INDIRECT(ADDRESS(SMALL(IF($I$4:$I$14>0,ROW($4:$14),""),ROW(A1)),8)),"")
Where 8 is a reference to the return column. For the range directly to the right, you'd use the same formula, just adjust 8 to 9. And for range Loaned Out you'd need
=IFERROR(INDIRECT(ADDRESS(SMALL(IF($K$4:$K$23>0,ROW($4:$23),""),ROW(A1)),10)),"")
And for the range directly to the right you would again change the 10 to a 11. Again, both of these are array formulas, so they have to entered slightly differently. See the link for further assistance with array formulas.
This is not trivial. If you cannot work with filtering or programming, you should make use of matrix formulas. I include an example with two formulas: 1st in D1:D5, 2nd in F2:G5. Enter them with Ctrl+Shift+Enter. Also, you should use an extra column to determine the "valid" rows. (You could put it all in one formula, but it would look even more complicated.)
Sorry for German excel. Wennfehler = iferror, kkleinste = small, zeile = row, wenn = if, bereich.verschieben = range.offset.
What are the types of identifying a cell as far i know it is
Sheet#.Cells(var,position) or Range(A1) are there any other types of identifying a cell.
Also I know how to increment Sheet#.Cells(var,position) but how do i increment Range(A1) in macros using while loop and any other mode?
I am trying to pick values based on condition from master sheet and populate output sheet row by row.
When I use Sheet#.Cells(var,position) it messes with the position when I get inconsistent data.
I'm not sure if I get right what you need. However...
In Excel you can use something like this:
Range("E10").Offset(row_move, column_move)
where row_move allows to offset in both top/bottom direction, column_move offset to left/right direction. To move top/left direction you need to use values <0.
There is other option which I personally don't like:
Range("A" & row)
but as you can see it's easy to change row position in that situation and more difficult to change column.
I have a SUM array formula that has multiple nested IF statements, making it very inefficient. My formula spans over 500 rows, but here is a simple version of it:
{=SUM(IF(IF(A1:A5>A7:A11,A1:A5,A7:A11)-A13:A17>0,
IF(A1:A5>A7:A11,A1:A5,A7:A11)-A13:A17,0))}
As you can see, the first half of the formula checks where the array is greater than zero, and if they are, it sums those in the second part of the formula.
You will notice that the same IF statement is repeated in there twice, which to me is inefficient, but is the only way I could get the correct answer.
The example data I have is as follows:
Sample Data in spreadsheet http://clients.estatemaster.net/SecureClientSite/Download/TempFiles/example.jpg
The answer should be 350 in this instance using the formula I mentioned above.
If I tried to put in a MAX statement within the array, therefore removing the test to find where it was greater than zero, so it was like this:
{=SUM(MAX(IF(B2:B6>B8:B12,B2:B6,B8:B12)-B14:B18,0))}
However, it seems like it only calculates the first row of data in each range, and it gave me the wrong answer of 70.
Does anyone know a away that I can reduce the size of the formula or make it more efficient by not needing to repeat an IF statement in there?
UPDATE
Jimmy
The MAX formula you suggested didnt actually work for all scenarios.
If i changed my sample data in rows 1 to 5 as below (showing that some of the numbers are greater than their respective cells in rows 7 to 11, while some of the numbers are lower)
Sample Data in spreadsheet http://clients.estatemaster.net/SecureClientSite/Download/TempFiles/example2.jpg
The correct answer im trying to achive is 310, however you suggested MAX formula gives an incorrect answer of 275.
Im guessing the formula needs to be an array function to give the correct answer.
Any other suggestions?
=MAX( MAX( sum(A1:A5), sum(A7:A11) ) - sum(A13:A17), 0)
A more calculation-efficient (and especially re-calculation efficient) way is to use helper columns instead of array formulae:
C1: =MAX(A1,A7)-A13
D1: =IF(C1>0,C1,0)
copy both these down 5 rows
E1: =SUM(D1:D5)
Excel will then only recalculate the formulae dependent on any changed value, rather than having to calculate all the virtual columns implied by the array formula every time any single number changes. And its doing less calculations even if you change all the numbers.
You may want to look into the VB Macro editor. In the Tools Menu, go to Macros and select Visual basic Editor. This gives a whole programming environment where you can write your own function.
VB is a simple programming language and google has all the guidebooks you need.
There, you can write a function like MySum() and have it do whatever math you really need it to, in a clear way written by yourself.
I pulled this off google, and it looks like a good guide to setting this all up.
http://office.microsoft.com/en-us/excel/HA011117011033.aspx
This seems to work:
{=SUM(IF(A1:A5>A7:A11,A1:A5-A13:A17,A7:A11-A13:A17))}
EDIT
- doesn't handle cases where subtraction ends up negative
This works - but is it more efficient???
{=SUM(IF(IF(A1:A5>A7:A11,A1:A5,A7:A11)>A13:A17,IF(A1:A5>A7:A11,A1:A5,A7:A11)-A13:A17,0))}
What about this?
=MAX(SUM(IF(A1:A5>A7:A11, A1:A5, A7:A11))-SUM(A13:A17), 0)
Edit:
Woops - Missed the throwing out negatives part. What about this? Not sure it it's faster...
=SUM((IF(A1:A5>A7:A11,IF(A1:A5>A13:A17,A1:A5,A13:A17),IF(A7:A11>A13:A17,A7:A11,A13:A17))-A13:A17))
Edit 2:
How does this perform for you?
=SUM((((A1:A5>A13:A17)+(A7:A11>A13:A17))>0)*(IF(A1:A5>A7:A11,A1:A5,A7:A11)-A13:A17))