When We write any formula, for specific function, we need to direct excel the specific location of that data. This location is referred as, Cell Reference. We know very well but how this useful and in which scenario it can be used ?
Cell references are way better than replicating a formula many times. It would be simple if you have a small spreadsheet, but what about thousands of complex computations? It is also better as it creates a more automated spreadsheet, such that when one value is changed other values automatically change.
Related
I'm practising MS Excel skills. I have a workbook in which I want to analyses data from different tables.
Each worksheet contains a table with the information from the year. So in worksheet "2017" I have a table named "Table2017". I have this for each year (starting 2015).
After a some research, I finally found a way to count how many times something in a certain place happened.
=SUM(COUNTIFS(Table2018[Place];B3;Table2018[Activity];{"Paid";"Awarded"}))
+SUM(COUNTIFS(Table2017[Place];B3;Table2017[Activity];{"Paid";"Awarded"}))
+SUM(COUNTIFS(Table2016[Place];B3;Table2016[Activity];{"Paid";"Awarded"}))
+SUM(COUNTIFS(Table2015[Place];B3;Table2015[Activity];{"Paid";"Awarded"}))
This works perfectly. It will calculate how many times per place a paid service or an awarded (gifted/sponsored) service was delivered. In the B column, I have a list of places (hence the B3 reference), so after completing the formula, I can select the cell and enlarge/drag to copy it to the rest of the column and apply for every place.
However, the formula is really long and every year upon creating a new worksheet, I need to add a new part to the formula.
Is there a way to compact this? And ideally have the formula search for every table that has the relevant information (like: "Table20??" or "Table 20*"), go in and count the times my conditions are found?
I hope my question is clear enough.
Thanks in advance!
P.S. I have zero experience in VBA/VBS, so I'm hoping to realize this in a normal formula.
There are ways to make it more compact, but they will necessarily make the function more complicated, so it wont be any easy win. See for yourself:
you basically need to be able to cycle through the years inside formula without creating custom formulas. One way to do this is to use ROW inside INDIRECT function. This way you can replace multiple
Table2015[Place]
with one array function containing
INDIRECT("Table"&ROW($A$2015:$A$2018)&"[Place]")
as it is an array function it will essentially cycle through the cells in the ROW function creating Table2015[Place], Table2016[Place], Table2017[Place] and Table2018[Place]. Your whole formula would look something like this
=SUM(COUNTIFS(INDIRECT("Table"&ROW($A$2015:$A$2018)&"[Place]");B3;INDIRECT("Table"&ROW($A$2015:$A$2018)&"[Activity]");{"Paid";"Awarded"}))
and it must be entered using ctrl+shift+enter (you will see {} brackets around the function). This should work to make the function smaller and you will need only to change the cell reference each year instead of adding another sum, but the question is if the separate sums are not easier to read and maintain.
Apologies if this question has already been asked somewhere but I couldn't find a definitive answer regarding if it's possible without VBA.
I need a function to be able to know whether a cell is part of a merged groups of cells or not. I have tried =cell() and none of the properties return anything that might give a clue that it is merged (the cells are all identical apart from the left-most cell in the merged group of cells obviously contains a value).
I have found a very good VBA function that quickly tests this How to get find if a cell in excel is merged? If the cell mrged how to read the value?, and it works great! But unfortunately I need this document to work in Google Sheets, and therefore cannot use VBA or macros.
Does anyone know if it is possible to test if a cell is merged in a non-VBA way. Or if it is possible to use this function in Google Sheets somehow?
Function IsMerged(rCell As Range) As Boolean
' Returns true if referenced cell is Merged
IsMerged = rCell.MergeCells
End Function
(Original code submitted by Vinny Roe - thanks!)
Quick answer - no, you probably can't do this without macros. And even if you could, you should avoid merging cells on formula sheets, because as you've already gathered, it can be a big inconvenience.
Long answer - you may be able to do this, assuming ALL of your cells have data in them [except the non-top-left portion of merged cells]. This would more or less just consist of you checking whether a cell was blank - and if it was, then what is the cell either directly above it or directly to the left of it which contains data.
Without knowing what you want this information for, it's hard to advise further, although really the point is that if you're looking at working with merged cells, don't.
I've been trying to find a list of the built in MS Excel functions that calculate "Whole Column" formula efficiently but haven't been successful, any ideas where I can go for this information? What i mean by this is exemplified below:
This documentation suggests that SUM and SUMIF formula automatically pick up on the last row of data, thus meaning that there is no efficiency reason why using a more restricted or dynamic range is preferable.
https://msdn.microsoft.com/en-us/library/office/ff726673(v=office.14).aspx#xlAllowExtraData
Answers for Excel 2003/7/10 are all welcome.
I think it would be fair to assume that ALL excel functions behave as teh article describes (ie the same as SUM and SUMIF). (I wasn't aware of this article, but it makes sense when you think about it...)
Behind the scenes the data in cells is stored in OO data structures such that only cells with non-default values and formatting will have been created.
It's highly probable that the value data and formatting data are help in separate containers.
So when Excel is using a formula on a range it is working on the data structures and consequently only works with the cells that have values.
I hope that a whole column with cells having different formatting (but very values) does not cause the SUM and SUMIF formulas to scan through every cell.
If in doubt you could do an experiment with the formulas you want to use.
The link you gave talked about formulas that behave differently and explicitly named VBA user created functions and array formulas - which makes sense.
Also, note that the article says using "Structured Table References" is the best approach. (ie not only storing your data in ranges but storing your data in excel tables. Created from a range using Ribbon:INSERT>Table).
These tables will allow any function to be used more efficiently as the range used is limited to the number of rows the table has.
I hope this helps.
Harvey
Is it possible to show the sequence in which formulas are processed in a Excel-sheet with many complex formulas?
In my case this is important because the formulas have dependencies to each other and I need to find out the sequence in which the formulas could be processed one after another.
Thanks in advance.
Excel dynamically adjusts the calculation sequence in such a way as to resolve the dependencies, and normally only recalculates the subset of formulas that are dependent on volatile or changed cells. In Excel 2007 and later this sequence is calculated in a multi-threaded way.
So in practical terms trying to determine the calculation sequence in a large complex workbook is not a good idea.
For more information see http://www.decisionmodels.com/calcsecretsc.htm and associated pages
Excel calculation order within formula
Excel calculates in a specific way within each formula. From the Microsoft documentation it will process from left to right but will process brackets (Aka parentheses) first. Excel evaluates in order of BODMAS
Excel calculation order between formula
Excel will determine which formula are independent of others and calculate those first. This includes formulae referring to cells that only contain values or forumulae that reference constants or volatile functions.
Finding the processing sequence
For starters, this is also known as tracing dependencies (and precedents). In Excel, in the formula tab on the ribbon you can access the audit functions that allow you to trace dependents or precedents. These will point you at the formulae that will be calculated before or after a given cell. This gives you the ability to step through the order so that you can ensure it's correct. For more detail on this I recommend this Microsoft article
Afternoon all :)
This is kind of a little difficult to explain but ill happily clarify where ever it is needed. Thank you for taking the time to read this post ^^ Here goes..
I am currently creating a spreadsheet that is been extracted from the database whereby I am tasked to concatenate data from 2 adjacent cells. I change the database on a frequent basis adding or removing data wherever necessary so the range of data is always different. To concatenate the two cells I use the following formula:
e.g: =IF(ISBLANK(B8&H8),"",B8&H8)
This formula works out great when im dealing with increasing amounts of data as I can simply drag the formula down as far as i want and i know that it will pick up the formula whenever I refresh the database without the need of seeing value errors when the formula ends up referring to a blank cell. The snag here (and my query as well) is if I have less data then before the formula within the last set of cells looks something like this:
e.g: =IF(ISBLANK(#REF!&#REF!),"",#REF!&#REF!)
I have dealt with #REF before in other spreadsheets whereby I simply used a ISERROR in the statement but I dont know if there is a possible way of including this within my formula. I need the ISBLANK there so I have more control and dont have to drag the formula as often.
If there is a better way around this or a way to amend the current formula Id appreciate the help :)
The only way you are going to get something like this:
=IF(ISBLANK(#REF!&#REF!),"",#REF!&#REF!)
in the formula bar is if you(or the system you are using) are somehow deleting the cells that were originally referenced. This should be avoidable. You can clear the cells referenced instead of deleting them completely - then you won't get this error - and your formulas will remain intact. Now you can certainly use the formulas provided in the comments to hide the errors - but the root of your problem seems to me to be that the errors are occuring in the first place. Good Luck.