Excel Named cell as a column inside of a formula? - excel

I have a value in A1 that is a named cell. I want to use that value to perform an equation on a column. Something like: sum(ColumnTest:ColumnTest)
So If A1 = "C" and its a Named cell "ColumnTest"
so If I typed the following into B1 I would get "6". =Sum(ColumnTest:ColumnTest)
C1 = 1
C2 = 2
C3 = 3
Any suggestions on how to do this?

You can use the INDIRECT function:
=SUM(INDIRECT(ColumnTest&":"&ColumnTest))
or simply:
=SUM(INDIRECT(A1&":"&A1))
if the cell wasn't named.

Related

Remove duplicate character in a cell

I have struggle with the following case:
In cell A1 = (a)(f)(a)(b)(a), cell A2 = (d)(a)(c)(d)(g)(d)(a)(d)
How can I get the result as follow:
Cell A1= (a)(b)(f)
Cell A2 = (a)(c)(d)(g)
I use substitute only substitute one (a) with “”.
Is there is an excel formula and vba to get the result.
Thank,
Joe
If you have TEXTSPLIT:
=CONCAT("("&SORT(UNIQUE(TEXTSPLIT(A1,,"(",1))))

Making Excel list more clearer to see the difference between the cells

In my list in Excel I have in Column A following data:
Cell A1 = GG-10000
Cell A2 = GG-10000
Cell A3 = GG-10005
Cell A5 = GG-10047
cell A6 = GG-10047
Cell A7 = GG-10047
Cell A8 = GG-10050
Cell A9 = GG-10050
Cell A10 = GG-10100
and so one...
Can someone tell me how to bold the lines as below
cell A1 = GG-10000 (this need to be in bold)
Cell A2 = GG-10000 (this need to be in bold)
Cell A3 = GG-10005
Cell A5 = GG-10047(this need to be in bold)
Cell A6 = GG-10047(this need to be in bold)
Cell A7 = GG-10047(this need to be in bold)
Cell A8 = GG-10050
Cell A9 = GG-10050
Cell A10 = GG-10100(this need to be in bold)
So the idea is that I can see the difference between the different numbers.
Many thanks
Robin
You can use conditional formatting.
If you have Office 365 Excel you can use this formula:
=ISODD(MATCH(A1,UNIQUE(FILTER(A:A,A:A<>"")),0))
UNIQUE => a list of the unique entries
MATCH => position of each individual entry in the unique list
ISODD => returns alternating boolean when the entry changes
If you don't have these Excel O365 functions, I'd suggest you develop a VBA routine or use a helper column to do something similar.
Here's an example of a "helper column"
I'll use column B, but you can use any column anywhere; and you can hide it.
B1: 1
B2: =IF(A2=A1,B1,-B1) and fill down
Conditional Format formula:
=B1=1
Since the CF Applies to range is unchanged, that will still be the range that gets formatted.
If you are okay with a helper column then in cell B1 put 1.
and in cell B2:
=IF(A2=A1,B1,B1+1)
which you shall copy down. Afterwards, for A1:A9 range apply conditional formatting like below:
The outcome if implemented correctly will look like below.

Store column name in an extra cell

By now, I use something like =function(tablename[[Columnname]:[Columnname]]). Is there an (easy) way to store Columnname in cell X1 and use something like =function(tablename[[X1]:[X1]])
My table named tablename:
ColumnA ColumnB
1 a
2 b
3 c
4 d
Cell A1 = ColumnA <-the string
Cell B1 = =COUNTA(tablename[[ColumnA]:[ColumnA]])
Cell A2 = ColumnB <-the string
Cell B2 = =COUNTA(tablename[[ColumnB]:[ColumnB]])
My aim is that the formulas in B1 and B2 use the values in A1 and A2.
What I tried yet is something like: =COUNTA(tablename[[INDIRECT(A1)]:[INDIRECT(A1)]])
The INDIRECT function converts a text string to a usable cell reference or in your case a structured (list object) table name.
=VLOOKUP(K3, INDIRECT(J3), 3, FALSE)
In my sample worksheet illustrated above, J3 is a Data Validation List with a source of AA2:AA3. K3 is a typed value and L3 contains the formula. If J3 is switched to Table1 then L3 becomes 66.

EXCEL how to set cell row from other cell value

Is there a way for me to set a row value from another cell value.
Example:
A1 = B62 = 'HELLO'
C1 = 62
So instead of 62 I want to set the value of C1.
A1 = B(C1) which would equal B62.
I hope I explained it well :P
Update:
This is the formula bar: =SUMIF('I1'!$C$2:$C$61,A2,'I1'!$F$2:$F$61)
Want to change the both 61 to my V4 cell value. For example if V4 = 10.
That would make =SUMIF('I1'!$C$2:$C$10,A2,'I1'!$F$2:$F$10)
Use the non volatile INDEX()
=SUMIF('I1'!C$2:INDEX('I1'!$C:$C,$V$4),A2,'I1'!F$2:INDEX('I1'!$F:$F,$V$4))
You'll want to use Indirect.
In C1, place your row value (15, for example). Then, in cell A1, use =Indirect("B" & $C$1)
Then as you change the value in C1, the value in A1 will change.

Excel sum with relative positions

How do I sum from whats in B2 to C2 ?
B2 = A10 or just 10 (preferred)
C2 = A25 or just 25 (preferred)
Normally you would just use SUM(A10:A25), but the values in B2 and C2 are not fixed, they change based on input.
I can use MATCH to find the numbers, but how do I tell SUM to use those numbers ?
The values to sum are always in the same column.
You can use the INDIRECT function for this, e.g.
=SUM(INDIRECT(B2):INDIRECT(C2))
if you can live with entering the entire cell name (A10, A25).
Or to just have the numbers in B2 and C2, you could use
=SUM(INDIRECT(ADDRESS(B2;1)):INDIRECT(ADDRESS(C2;1)))
(Hope I got the columns and rows in the right order!)
You want to specify Cell Co-ordinates in the value of a Cell ?
Is that what you're getting at ?
Try Setting
B1 = "A10"
C1 = "A25"
D1 = =SUM(INDIRECT(B1):INDIRECT(C1))
Use the INDIRECT() function. You pass it a string that is a range, which allows you to have a dynamic range based on input.

Resources