Easy One - reference to non-sequential cells - excel

I'm sure this has been asked before, but I couldn't figure out the right search terms to get the answer I was seeking, so apologies...
I have one worksheet with regular but non-sequential data (i.e. values in A1, A11, A21...)
In another sheet, I want to be able to put in a formula to get the values from those cells, and have it be easily scalable so I can drag the formula down and continue to get every nth cell from Sheet1. It looks like OFFSET will work, but it's not that elegant. VBA seems like overkill...Is there a better way?
Thanks!

Either Offset like you said, or something like this would be on the other sheet in Row 1 and copied down (assuming the first sheet is called 'sheet1', or change to the actual name:
=INDIRECT(ADDRESS(ROW()*10-9,1,,,"sheet1"))
Offset would be even clearer:
=OFFSET(Sheet1!A1,((ROW())-1)*10-ROW()+1,0)

Related

Clear Cell contents depend on other cell content

My first post here, maybe someone will be able to help.
I have a large Excel table with data from labs. Some results are below LOD And I need to remove them as I do not need them.
So basically I need to clear data in one cell, say E11, if data in D11 shows "<". Meaning below LOD.
If possible I would like to replace value in E11 with "-".
Is there any one who could help me please.
There are a few ways to go about this and you don't really need VBA.
Without VBA - Create a filter on your results and simply filter away the "<" - you could copy and paste this filtered table to another sheet
You could use a cell formula to help you identify results: =IF(A1="<","",B1) which would look at A1, if A1 was a < then it'd return nothing, otherwise it'll return value in cell B1.
With VBA - you'd basically be applying the same logic, just written in code. If you really want to do this, then look up how to do a loop first and how to use IF logic...
enter image description here
This is the worksheet I work with. I would like to clear all the values where < is next to them. This is just part of much bigger table.

How to get a column which contains a particular data in a row excel

This is probably very easy for experienced user of excel, but I couldn't find a way to do this, so I asking this question.
I have particular range of cells, let's say E5:M5, only one cell of this range will contain 1, other will contain 0. I want to reference, first cell of that column (which contains label). I want to do this by using a formula in another cell. In the end, that another cell should have label name as its value.
I wanted to post image elaborating what I want, but it seems I can't do that.
Anyway, can anyone tell me how this can be done?
I'm going to assume you want to use a formula rather than VBA as it is not recommended for inexperienced Excel users to use VBA. Use this formula to determine the first column out of your set, which has "1" as a value:
=match(1,E5:M5,0)
If by 'label name' you mean you have a header or something (let's assume in row 4), you can use the index function to pull the value from the mirror set of rows above the match function, like so:
=index(E4:M4,match(1,E5:M5,0))

How to reference cell within '' worksheet title

I have the names of the tabs/worksheets (M-61,M-62,M-63W) at the top row (A1, B1, C1...etc)
I am trying to get a sum of several cells within the different sheets:
=SUM('M-60'!H21,'M-60'!H43,'M-60'!H86,'M-60'!H87,'M-60'!H97,'M-60'!H98)
However, right now I’m referring to the sheet itself, and have to apply the same formula to all the other sheets. This will require me to manually go and change all the sheet titles accordingly.
I was wondering if there is any way to reference the top row with the sheet titles within the formula so it automatically refers to the row text instead of me having to manually change the sheet title.
Edit
Now i got the reference to work, just wondering how would I do a sum of several cells in that tab
=INDIRECT("'"&$F1&"'!H87",TRUE)
Maybe:
=SUM(INDIRECT("'"&C1&"'!H21"),INDIRECT("'"&C1&"'!H43"),INDIRECT("'"&C1&"'!H86:H87"),INDIRECT("'"&C1&"'!H97:H98"))
(though there may well be a much smarter way).
You can use the INDIRECT function, which uses a string as an argument and converts it to a range. So
=M-60'!H21
is the same as
=INDIRECT("M-60'!H21")
or, if Sheet name is stored in, say, cell C1:
=INDIRECT(C1&"'!H21")
Your example has a SUM, though, which requires some adaptations. This your example:
=SUM('M-60'!H21,'M-60'!H43,'M-60'!H86,'M-60'!H87,'M-60'!H97,'M-60'!H98)
Since you are not using a range, you can convert that SUM into simple addition. Assuming Sheet name in cell C1
=INDIRECT("'"&C1&"'!H21")+INDIRECT("'"&C1&"'!H43")+INDIRECT("'"&C1&"'!H86")+INDIRECT("'"&C1&"'!H87")+INDIRECT("'"&C1&"'!H97")+INDIRECT("'"&C1&"'!H98")
This should solve your problem. More info here
By the way, if you were using a range, the OFFSET function with INDIRECT as an argument would work. But that's not necessary here.

How do I use the result of one function in another function to get the value stored in a cell in another sheet in Excel?

In my current sheet I have some numbers in a column, which represent the row which I want to get the data from in another sheet. And I want to get it from the same column in which I am using the function...
I know using =Sheet1!A1 for instance gets me what is in A1 on Sheet1
and
=CONCATENATE("A",A1) being on sheet two, brings me back A + whatever value is stored in A1 on sheet number two... for simplicity let's say it's a one... so it would return A1
I am on Sheet2
I'm trying
=Sheet1!CONCATENATE("A", A1)
but the formula contains an error, I've tried rewriting this in many ways but it never works... any idea what the correct syntax I need is?
Greatly appreciated!
THanks
As Magicianeer said, you have to use the INDIRECT function. For your example:
=INDIRECT(CONCATENATE("Sheet1!","A",A1))
Should give the results you need.
However, it's a bit lengthy, and you can use & instead of CONCATENATE, and you can directly use Sheet1!A:
=INDIRECT("Sheet1!A"&A1)
What is evaluated in the brackets is Sheet1!A1, and INDIRECT converts this from text to a reference.
Try:
=CONCATENATE("A", Sheet1!A1)

INDIRECT for a whole column on another sheet

Ive searched around for how to use the indirect command for a whole column (on another sheet) but with limited responses
Ive seen it has to be something like this
=SUMIF(Site!$A:$A,D11,indirect("Site!$F",Row($F))
The reason I want to use indirect is because the cells on that sheet are always changing (and columns are being delted / recreated automatically) - But the data I need will always end up in the same cell (But the formula automatically readjusts when you delete a col etc)
Any help would be awesome
You mean you just always want to sum column F in your example? You can just use:
=SUMIF(Site!$A:$A,D11,INDIRECT("Site!$F:$F")
If that's so.

Resources