google sheet : extract column Name from address - google-sheets

I try to get the column name from cell address, for example :
AB123 --> AB
X90 --> X
When using address(), it will return in $COL$ROW format. I want to get rid the $ symbol and the number/row and just need that column name.
Also using column() i can get the index, not the name.
How can i do it in quite simple way ?
Thanks

Use Address, but set the row number to 1 and use option 4 to remove $ signs:
=substitute(address(1,column(AB123),4),"1","")

Related

using SWITCH() Formula in Google Sheets using hash-map

In my Google Sheet table, I use SWITCH command to convert a cell from coin symbol -> into coin value.
what I currently do:
=SWITCH(D660,"₪","ILS","$","USD","Ft","HUF","€","EUR","лв","BGN","£","EGP")
this will convert cell D660 from coin symbol (₪/$/Ft/€/лв/£) -> into coin name
here's an example of my data:
where in column E I have the equation above.
what I want to do:
I want to a more generic way, where I have a "hash-map" table in my Settings tab which contains the following table:
coin_symbol
coin_name
₪
ILS
$
USD
Ft
HUF
€
EUR
лв
BGN
£
EGP
and now I want the =SWITCH(D660,...) to use the table instead of hard coding inserting the conversion table
.
I'm struggling on this one, I tried stuffs like
=SWITCH(D660,A1:A10,B1:B10) or involving ARRAYFORMULA somewhere but nothing worked.
anyone have a suggestion how to implement that?
You can use VLOOKUP()
In table with the coins symbols and value as you described ( where symbols is column A and name column B)
=VLOOKUP([SYMBOL];[A1:B6];2;FALSE)
Where:
Symbol is the symbol you want to replace ( you can use cell reference );
A1:B6 is the table you want to look in;
2 is the column in wich you take the value;
False as the values are not ordered by a number, just use false.
/!\ depending on your locatioon the ; in my formula might have to be replaced by ,
Here's an example you could use

How to remove a piece of text from a cell?

I'm trying to remove a piece of text (Perfomance) from a column in Google Spreadsheet that contains (XX Performance) XX is a number like 89. I'm using:
=REGEXREPLACE(D:D, " Performance "," - ")
But no love...
enter image description here
Try this Example Sheet
=ArrayFormula(IF(D2:D="",, REGEXEXTRACT(D2:D, "[0-9]+")))
You can use the expression \D+:
\D matches any character that's not a digit (equivalent to [^0-9])
+ matches the previous token between one and unlimited times, as many times as possible, giving back as needed
The formula will be like:
=REGEXREPLACE(D:D, "\D+","")
UPDATE
I did put it in another column otherwise it creates a circular dependency. The data is imported via API from another app.
Then you will need to create another sheet or use a hidden column to put that information and then use the regex on the column you want the final result.

Is it possible to update part of a named range string in a formula using the value from a variable in another cell?

Here is an example of a formula I have written:
=DatabaseVerName&"."&INDIRECT(ADDRESS(4,2,1,TRUE,""&B2&"ChangeLog"))
DatabaseVerName is a named range ...It just so happens that the first word in the string (in this case Database), is the value in cell B2. I would like to be able to update the formula so that when I change the value in B2 (say to the word Report) that the formula references the named range "ReportVerName" and not "DatabaseVerName". FWIW, B2 is a a data validated list with 4 options available.
Is this possible and if so how would I do it?
I haven't tested it, but something like this might work.
=INDIRECT(B3 & "VerName") & "." & INDIRECT(ADDRESS(5,2,1,TRUE,""&B3&"ChangeLog"))
So B3 would be equal to "Database" or some other text, and would get concatenated in front of "VerName" to make up the name of a matching named range and then the remaining part of the address, which appears to have been working for you, would be added.
I haven't tested this, but I think it should work. Let us know.

is it possible to lookup a cell value and populate a drop down box with the results in a separate cell

I have a google sheet with all current staff information. I have a second sheet for when some piece of data needs changed. Last name, Location, job ect.
on second sheet I am looking to have someone:
Enter the user's first name in column B,
and or Last name in Column C,
I would like a drop down box generated in column D from the given info to contain all usernames found in the sheet with current information for all staff that have the given first and or last names provided.
Once a username has been selected, I can get all the pertinent data from that user with a vlookup from the sheet containing all staff info. For example if someone typed Scott in column B, I would like a drop down generated in column D with all staff that have a first name of Scott. Likewise if the last name was supplied and of course if both first and last was supplied.
Validation need to be done that's it,
1) Go to Staff Changes'!B2 and Data Validation> List from range & choose range from 'Staff Info'!B2:B
2) Select cell'Staff Changes'!D2 and Data Validation> List from range & range will be filter formula i.e 'Staffing Changes'N2:N.
Result
Few tweaks in vlookup:
I am not sure if you need username column twice if you don't need then change your vlookup formula from =vlookup(D2,'Staff Info'!A:K,10,0) to =VLOOKUP(D2,'Staff Info'!$G$1:$K,2,0)
Please provide access to trix in future so that changes & result can be shown in it.
UPDATE:
Use data validation as before & hide filter colum or use seperate sheet for filter formula & use query function in cell A3 =QUERY('Staff Info'!A:J,"select ' ',A,F,' ',' ',G,' ',I,' 'where A='"&A2&"' AND F = '"&B2&"' LABEL ' ''Date',' ''Current Last Name',' ''New Last Name',' ''New Building',' ''New Classification'",1) result wil be something like this
QUERY

Trying to find the content of a cell next to the array formula's match

I tried to find if someone had a similar request but I really can't find anything anymore. Basically, I got the following set up:
I got 2 named Ranges, both with 1 column called "ID":
Named Range 1: Rank, Real Name, ID
Named Range 2: UserName, Email, Tag, ID
Now in the second Range, I would like to add a column with the rank of the user but only if that ID also appears in range 1.
What I tried to do was a MATCH function, but I can only get a string to come out if the IDs match, not the rank which is in a different column (column A of the second range).
=ArrayFormula(IF(ISERROR(MATCH(D2:D200,'Top 100 List'!C2:C151,0)),"No","Yes"))
I got it to write "Yes" to all the items that are also in the other named sheet but instead of that, I would like to give me the value of the named range in A from that specific cell.
Edit: I made a copy of the sheet because of sensitive information so you can see it In the sheet "Registrations" column H I would like to get the ranks from the other sheet:
https://docs.google.com/spreadsheets/d/1PzItmS3j-orH74E2zFlNWbvw39GdDGwuYL_jgzNAi7U/edit?usp=sharing
=ARRAYFORMULA(IF(LEN(C2:C),IF(ISERROR(MATCH(D2:D200,'Top 100 List'!C2:C151,0)),"No",
VLOOKUP(D2:D,{'Top 100 List'!C2:C151,'Top 100 List'!A2:A151},2,0)),))

Resources