CELL("contents", ) in EXCEL - excel

I have a cell (A1) in sheet 4 that is containing the following formula:
=CELL("contents",Sheet1!B61)
However, I want to find the content of the result. When I try to formulate it
=CELL("contents",A1)
The result is the same.
What I want to find is the content of =CELL("contents",Sheet1!B61). Is it possible to enclose it with a cell function twice? I've been trying to formulate it but there is always an error.

I cannot imagine a scenario in which it would be necessary to generate text strings representing cell addresses and then reference these in formulas. However:
=CELL("contents",INDIRECT(Sheet1!B61))
is what you require.
Regards

=CELL("contents",Sheet1!B61) is the same as =Sheet1!B61.
I think you are looking for INDIRECT which will translate a cell address given as text to the value contained in the cell.
=INDIRECT(Sheet1!B61)

Idk, try a nested CELL(CELL=(...)) not sure if it will work but...
Also, can you clarify exactly what you want? When you have
=CELL("contents",Sheet1!B61)
I assume the result is a number or text or whatever
Then you say, "I want to find the content of the result". What do you mean here? You want the cell (A1) in sheet 4 to display something other than the result of the formula above? If so, just change the formula. I think I'm a little lost here...

Related

Modify my Index Match to look for 'cells containing value' instead of exact match?

I have this formula that works great to pull all uc's for a given actor.
=INDEX(uc_name, SMALL(IF(ISNUMBER(MATCH(actor,$A$2,0)), MATCH(ROW(actor),ROW(actor)),""), ROWS($A$4:A4)))
But right now its only pulling results if the cell contains only 'Actor x' where some cells might actually have multiple Actors written into the cell. Anyway to modify this formula to return values whenever the actor is included in the cell?
Hoping I don't have to start over and use a different formula altogether since this is driving a bunch of other things on the workbook- I just now realized its not grabbing those 'contains' ones though.
Thanks in advance!
I think you want:
=INDEX(uc_name,AGGREGATE(15,7,(ROW(actor)-MIN(ROW(actor))+1)/(ISNUMBER(SEARCH($A$1,actor))),ROW($ZZ1)))
Or if one has the Dynamic Array Formula FILTER():
=FILTER(uc_name,ISNUMBER(SEARCH($A$1,actor)))
Add a wildcard to your match:
=INDEX(uc_name, SMALL(IF(ISNUMBER(MATCH("*"&actor&"*",$A$2,0)), MATCH(ROW(actor),ROW(actor)),""), ROWS($A$4:A4)))

VLOOKUP Multiple Columns If Not Found In First Column

I have a long list of part numbers where I need to be able to lookup and retrieve information on them.
These parts can have several alternative part numbers. I have figured out how to get the data returned if my data table only shows one of the possibly part numbers.
The issue is that I want it to be able to look up the columns to find a matching value.
As in the picture below for example. 5-E26 is the equivalent to E5-25. So if I input 5-E26 in the cell, I want it to continue searching to find the value in B7, and return the data as done A4 and A5.
Is this possible to do with Vlookup? Or is there a smarter method for it?
I struggle to fully understand how your data works but here is a possibility:
So the translated version of the formula I used in G2:
=INDEX($D$1:$D$5,AGGREGATE(15,3,((($A$2:$D$5=F2)/($A$2:$D$5=F2))*ROW($A$2:$A$5)),1))
You could also try (in my case):
=INDEX($D$1:$D$5,SUMPRODUCT(($A$2:$D$5=F2)*ROW($A$2:$D$5)))

VBA Excel - From formula to list

I have a formula with defined names
=AVERAGE(DN1,DN2,DN3,DN4)
Is there any formula/function to give me those defined names in a table? So something looking like
Header
DN1
DN2
DN3
DN4
Thanks
In VBA Range("A1").Formula will return the formula contained in cell A1 as string of text.
With a bit more VBA you should be able to parse that text to get you the names you want and to list them on an appropriate bit of worksheet.
The ease with which you will be able to do this will depend on the amount of variety you have in the formulae which you want to analyse.
In the end I have been able to achieve the job using a couple of user defined functions, the use of array and its Split function. If anyone wants any help give me a shout. Thanks anyway to all of you who tried to help. CM

Excel: If vlookup returns specific text, countifs number of instances (multiple)

First post, but I am stuck and was hoping for some help. What I am trying to do is use a nested IF formula to determine whether the value returned by a VLOOKUP matches specific text on another sheet in the same workbook. If it does, to then use the COUNTIFS function to determine the sum of instances that specific text contained in a specific cell appears on another sheet (also in the same workbook).
One part of these formulas seems to work, but when I combine it with others, it errors and I can't figure out why.
It's probably something simple, but I'd appreciate any help. Here's the part that seems to "work"
=IF(VLOOKUP($A3,'Sheet1'!$B:$D,3,FALSE)="All",
(COUNTIFS('Sheet2'!$U:$U,'Sheet3'!$A3,'Sheet2'!$C:$C,"MM/DD/YYYY")
+
(COUNTIFS('Sheet2'!$R:$R,'Sheet3'!$A3,'Sheet2'!$C:$C,"MM/DD/YYYY")))
If I put one more parenthesis, it works as is, but seems to omit some of the "All" Vlookup results... thus why I put works in quotations above. That might be an issue with my spreadsheet though, but felt I should include in case I'm just being idiotic. Regardless, when I input two additional IF statements, it errors.
The final formula I've crafted looks like this (double spaced for ease of reading only):
=IF(VLOOKUP($A3,'Sheet1'!$B:$D,3,FALSE)="All",
(COUNTIFS('Sheet2'!$U:$U,'Sheet3'!$A3,'Sheet2'!$C:$C,"MM/DD/YYYY")
+
(COUNTIFS('Sheet2'!$R:$R,'Sheet3'!$A3,'Sheet2'!$C:$C,"MM/DD/YYYY")))),
IF((VLOOKUP($A3,'Sheet1'!$B:$D,3,FALSE)="One",
(COUNTIFS('Sheet2'!$U:$U,'Sheet3'!$A3,'Sheet2'!$C:$C,"MM/DD/YYYY")),
IF((VLOOKUP($A3,'Sheet1'!$B:$D,3,FALSE)="Two",
(COUNTIFS('Sheet2'!$R:$R,'Sheet3'!$A3,'Sheet2'!$C:$C,"MM/DD/YYYY"),
IF((VLOOKUP($A3,'Sheet1'!$B:$D,3,FALSE)="Three",
(COUNTIFS('Sheet2'!$U:$U,'Sheet3'!$A3,'Sheet2'!$C:$C,"MM/DD/YYYY")),"0"))
Any ideas?
Thanks!
Ryan Olson
Just cleaned up some bracketing. Let me know how it goes as I didn't alter the formula otherwise.
=IF(VLOOKUP($A3,Sheet1!$B:$D,3,FALSE)="All",
COUNTIFS(Sheet2!$U:$U,Sheet3!$A3,Sheet2!$C:$C,"MM/DD/YYYY")+(COUNTIFS(Sheet2!$R:$R,Sheet3!$A3,Sheet2!$C:$C,"MM/DD/YYYY")),
IF(VLOOKUP($A3,Sheet1!$B:$D,3,FALSE)="One",
COUNTIFS(Sheet2!$U:$U,Sheet3!$A3,Sheet2!$C:$C,"MM/DD/YYYY"),
IF(VLOOKUP($A3,Sheet1!$B:$D,3,FALSE)="Two",
COUNTIFS(Sheet2!$R:$R,Sheet3!$A3,Sheet2!$C:$C,"MM/DD/YYYY"),
IF(VLOOKUP($A3,Sheet1!$B:$D,3,FALSE)="Three",
COUNTIFS(Sheet2!$U:$U,Sheet3!$A3,Sheet2!$C:$C,"MM/DD/YYYY"),"0"))))

Excel, Specifying cell contents as a result of other cells

I don't use excel often, and I haven't really found a good solution to my problem. (which is probably really simple).
I would like to have a cell with a function in my spreadsheet that shows another cell value value that depends on yet another cell value.
Such as:
The Best Deal heading simply uses the formula
=MAX(D3,D1000)
But under Best Deal I would like to display the Name Test1 rather than the numeric value.
Another thing that would be nice to know, is if there is a way to know the maximum row with data in it. So rather than =MAX(D3,D1000) something like =MAX(D3,Max(RowCount_InD))
Obviously that function wouldn't work as I wrote it, but hopefully this pseudo code gives you an idea of what I mean. The purpose is that if more entries are added, it would be able to handle them.
I know this is possible, but I'm having some trouble. Hopefully I can get some help here.
Thanks!
The easiest way to do this is to use a combination of Index and Match. Match will find the position of the maximum value, and then Index will look in column A and return the data in that same position. So, your formula would be:
=INDEX(A$3:A$1000,MATCH(MAX(D$3:D$1000),D$3:D$1000,0))
Put that formula in F3. No hidden columns required.
Sorry, I missed the part about the expanding range. You can do that by using Count or CountA along with Offset. The new formula would be:
=INDEX(A3:OFFSET(A3,COUNTA(A:A)-1,0),MATCH(MAX(D3:OFFSET(D3,COUNT(D:D)-1,0)),D3:OFFSET(D3,COUNT(D:D)-1,0),0))
More complex, but it is basically the same except that it will expand as you add new values at the end.
There is only one 'simple' way I can think of this, but it requires hidden columns (sorry).
set E1 = A1 and fill down all the way (Basically you are making a copy of column A in column E but you are using a formula so it will always be the same)
Then under 'Best deal' - put this formula:
=VLOOKUP(MAX(D3,D1000),$D:$E,2,FALSE)
Then hide column E so it doesn't look like a mess. This way you do not need any fancy macro's and it will work everywhere because it is a normal formula.
"Another thing that would be nice to know, is if there is a way to know the maximum row with data in it. So rather than =MAX(D3,D1000) something like =MAX(D3,Max(RowCount_InD))"
This is a called a dynamic named range. Create a name for the ratio data, and set up the formula for the name range to be this:
=OFFSET($D$3, 0, 0, COUNTA($D$3:$D$1048576), 1)
More info here: http://www.ozgrid.com/Excel/DynamicRanges.htm
Then, assuming you name this named range ratio_data, your function could be referring to =MAX(ratio_data) in combination with index-match as suggested by #Tim Mayes. The range will expand automatically as you add more data.
=INDEX(A$3:A$1000,MATCH(MAX(ratio_data),ratio_data,0))
Ideally, you can replace the A3:A1000 by a dynamic named range as well.

Resources