Using Connection Names - excel

Is there anyway to use the Connection Names rather than the connection link in the Excel formulas?
Example:
Connection Name - Test1
Connection Link - www.www.www.com
Current Equation - =IF('www.www.www.com[test1.xlsm]Sheet1!'K1=0, "--", 'www.www.www.com[test1.xlsm]Sheet1!'K1)
Desired Equation - =IF('Test1'Sheet1!K1=0, "--", 'Test1'Sheet1!K1)
Does anyone know if its possible? My addresses are really long and would be easier.

One option is to use Indirect - which uses the content of a cell in a formula - rather than its address.
As such, for your example - you could have the string 'www.www.www.com[test1.xlsm]Sheet1!'K1 in a cell - such as A1 then in your formula you could refer to it as =IF(INDIRECT(A1)>0,"--",INDIRECT(A1))
Other than that, you'd probably have to look at a custom vba function. (I'll not go into that with the lack of tag)

Related

Returning a column reference from MATCH to avoid using INDIRECT with a Named Range

TL;DR: I'm basically trying to obtain a column range such as 'Sheet 1'!$A:$A where the A is obtained by matching the contents of a given cell to a 1:1 range within a sheet referenced by another given cell, for use in a dynamic range.
In the highly probable case where that made zero sense, here's an illustration:
PARAMETERS: A2 = "LIST" | C2 = "FirstName" | Desired result: 'LIST'!$A:$A
And I've obtained that, BUT, I can't use that output ('LIST'!$A:$A) within formulas (namely to create a dynamic range). For instance, here 'LIST'!$A:$A contains 101 cells with values in them:
V3 = NamedFormula = 'LIST'!$A:$A
COUNTA(INDIRECT(V3)) = 101
COUNTA(INDIRECT(NamedFormula)) = 1 because it evaluates to #VALUE and that is a singular result.
Before delving into the topic of using INDIRECT with a Named Range (which I've read about and am still getting over my confused grief), I'm realizing my Names are getting a bit out of hand. I tend to use Excel like a mad scientist. So, in case there's a much simpler solution to what I'm trying to do, here's my actual mission:
0. I'm building a tool to simplify a process where email addresses are built from different data, which needs to run without any scripts, only formulas.
1. A tab with no imposed name would contain a user database with minimally (firstname and lastname OR IDs) AND (potentially other data columns) in no specific order. Tool users would import that tab from wherever the data got to them depending on the client, and would only need to copy-paste relevant headers to the main tab without changing anything else here for data integrity.
2. The main tab would have specific input fields where tool users would paste in the name of the imported tab as well as the labels of the columns they need (for instance, the labels in the first row of the columns containing the first name and the last name), and an input field for the domain name to use to build those email addresses.
3. A Data tab is referenced for cleaning and preparing strings for email address formats.
4. The Export tab would spew out a list of clean email addresses that can be exported to CSV.
The Data tab is just 2 columns to use with SUBSTITUTE so that for instance apostrophes are removed but accented letters are normalized (é -> e). I've used LAMBDA within Names to get there. The problem is to tie everything in - to get those Named ranges into the final formula.
The Names I'm using so far (I'd like to use fewer but testing specific parts extended beyond simple usage I fear):
ALPH ={"A";"B";"C";"D";"E";"F";"G";"H";"I";"J";"K";"L";"M";"N";"O";"P";"Q";"R";"S";"T";"U";"V";"W";"X";"Y";"Z"}
LABELS =LAMBDA(labelname,ADDRESS(2,MATCH(labelname,INDIRECT("'"&PARAMETERS!$A$2&"'!$1:$1"),0),1,1,PARAMETERS!$A$2))
RANGECOL =LAMBDA(labelname,COLUMN(INDIRECT(LABELS(labelname))))
RNCOL =LAMBDA(label,"'"&PARAMETERS!$A$2&"'!$"&INDEX(ALPH,RANGECOL(label))&":$"&INDEX(ALPH,RANGECOL(label)))
I haven't tied everything in the Data tab yet - I'm still trying to automate my main tab before pushing further and using the Data tab substitutions on top of everything. That will be the next step, not my current focus. But, for the curious and interested, on the Data tab I'm using something something I found on ablebits which works wonders =]
So, now if I use the offset range with a static LIST!A:A it works:
=IF($C$2<>"",LOWER(INDEX(OFFSET(INDIRECT(ADDRESS(2,MATCH($C$2,INDIRECT("'"&$A$2&"'!$1:$1"),0),1,1,$A$2)),0,0,COUNTA(LIST!A:A)-1,1),ROW())),"") &IF($C$3<>"","."&LOWER(INDEX(OFFSET(INDIRECT(ADDRESS(2,MATCH($C$3,INDIRECT("'"&$A$2&"'!$1:$1"),0),1,1,$A$2)),0,0,COUNTA(LIST!A:A)-1,1),ROW())),"") &"#"&$C$4
But when I try to use the dynamic RNCOL($C$3) it does not:
=IF($C$2<>"",LOWER(INDEX(OFFSET(INDIRECT(LABELS($C$2)),0,0,COUNTA(INDIRECT(RNCOL($C$2)))-1,1),ROW())),"") &IF($C$3<>"","."&LOWER(INDEX(OFFSET(INDIRECT(LABELS($C$3)),0,0,COUNTA(INDIRECT(RNCOL($C$3)))-1,1),ROW())),"") &"#"&$C$4
This just gives #REF, and evaluating shows the digression starting at INDIRECT(RNCOL($C$3)) equating to #VALUE.
I'm starting to see double here but my undying and completely normal love for Excel prevents me from going home from work as I'm way too far down the rabbit hole to let my obsession die here.
Any pointers as to how this can work?
Note - all of the names in the supplied sheet were generated by an online fake name generator, nothing in here is actual user data #GDPR
Thanks in advance! <3
Test sheet is available via Google Drive.
Your current set-up is not good for many reasons, and in my opinion would require a complete overhaul, the scope of which lies beyond a response on this website.
As to a 'quick fix' to your current issue, the reason your formula in E1 is currently returning an error is due to the fact that, as you can see via stepping through with the Evaluate Formula tool, the part
COUNTA(INDIRECT(RNCOL($C$2)))-1
is resolving to
COUNTA(INDIRECT({"'LIST'!$A:$A"}))-1
and this is not the same as
COUNTA(INDIRECT("'LIST'!$A:$A"))-1
in that the value being passed to INDIRECT is an array in the former though not in the latter. Although INDIRECT can accept arrays, it is only within certain constructions in conjunction with other suitable functions; here it will simply error.
And the reason that it is returning an array is due to the fact that RNCOL($C$2) is returning an array, and that is because that function is defined as
=LAMBDA(label,"'"&PARAMETERS!$A$2&"'!$"&INDEX(ALPH,RANGECOL(label))&":$"&INDEX(ALPH,RANGECOL(label)))
and, since RANGECOL($C$2) resolves to 1 here, the above is equivalent to
"'PARAMETERS!$A$2'!$"&INDEX(ALPH,1)&":$"&INDEX(ALPH,1)
Here, because you are omitting the column_num parameter from INDEX, the part
INDEX(ALPH,1)
is resolving to
{"A"}
which is an array (albeit one comprising a single value) and technically different from
"A"
In most circumstances, this is not an issue. As such, it is almost always unnecessary to pass both a row_num and column_num parameter to INDEX when indexing a one-dimensional array. Here, however, it matters.
You can resolve this by explicitly including a column_num parameter, i.e. redefine RNCOL as
=LAMBDA(label,"'"&PARAMETERS!$A$2&"'!$"&INDEX(ALPH,RANGECOL(label),1)&":$"&INDEX(ALPH,RANGECOL(label),1))

How to automate split by delimiter in Excel (equivalent of =SPLIT in gSheets)

Having recently moved from full-time Google Sheets -> Excel, I'm still getting used to a few things being missing... I'm needing to split cells in Excel using a delimiter of space (" ").
I'm looking for a way to do this with a formula in Excel. The Excel equivalent of =SPLIT(#REF, " ") in Google Sheets. I'm aware Excel has a "Text to Columns" feature, but I'm trying to fully automate a project, to reduce the chance of human error, so would be after a formula instead.
Additionally, I need to maximise the number of splits to 4, so it ignores everything after the 4th split.
I've tried a few things, such as using =LEFT(#REF,FIND(" ",#REF)),=RIGHT(#REF,FIND(" ",#REF)), and =MID(#REF, SEARCH(" ",#REF) + 1, SEARCH(" ",#REF,SEARCH(" ",#REF)+1) - SEARCH(" ",#REF) - 1). The issue is, the number of spaces within the cell can vary. Please see an example table below:
ToSplit
Split #1
Split #2
Split #3
Split #4
Hello
Hello
World
World
Hello World
Hello
World
Hello World FOO BAR BAZ
Hello
World
FOO
BAR
This Data Wants To Be Different
This
Data
Wants
To
Is there any way to obtain this functionality within Excel, please? Thanks!
Multiple ways, one is to use FILTERXML():
Formula in B2:
=TRANSPOSE(FILTERXML("<t><s>"&SUBSTITUTE(A2," ","</s><s>")&"</s></t>","//s[position()<5]"))
This assumes ms365's spilling dynamic arrays. However, you could also use, for example:
=IFERROR(FILTERXML("<t><s>"&SUBSTITUTE($A2," ","</s><s>")&"</s></t>","//s["&COLUMN(A1)&"]"),"")
Drag down and right.
More information on FILTERXML() and another custom SPLIT() function, see this Q&A.

Excel advanced vlookups for a schedule comparison

I wondering if anyone will be able to help me sort the formula below out:
=IFERROR((VLOOKUP($D96,August!$C:$P,F$78,FALSE))-(VLOOKUP($D96,July!$C:$O,(F$78+1),FALSE)),IF(U96="NEW PART",(VLOOKUP($D96,July!$C:$O,(F$78+1),FALSE)),IF(V96="NEW PART",(VLOOKUP($D96,August!$C:$O,(F$78),FALSE)),"")))
Originally the formula was
=IFERROR((VLOOKUP($D95,August!$C:$P,F$78,FALSE))-(VLOOKUP($D95,July!$C:$O,(F$78+1),FALSE)),"BLANK")
However rather than returning "BLANK" if either sheet does not include that part number I would like the formula to return the figure on the one sheet they appear on. Columns U and V highlight weather the product number is on each sheet. These figures would be + figures if they appear in august and minus figures if they appear in July.
Link/screenshot refer:
In short - replace final 'FALSE' with an additional iferror(Aug,-July)
(see revision at end, following comments / feedback re sound applications/customizing soln as required)..
Formula - per OP request
=IFERROR(VLOOKUP(H4,B4:C14,2,FALSE)-VLOOKUP(H4,E4:F14,2,FALSE),IFERROR(VLOOKUP(H4,B4:C14,2,FALSE),-VLOOKUP(H4,E4:F14,2,FALSE)))
Improvised version
(pre-requisite: Office 365 compatible version of Excel)
=LET(A,INDEX(C4:C14,MATCH(H4#,B4:B14,0)),B,INDEX(F4:F14,MATCH(H4#,E4:E14,0)),IFERROR(A-B,IFERROR(A,-B)))
Motive
Arguments in favour of this version include:
OP version: 127 chars (vs 104) i.e. ~20-25% length reduction on this basis
Audit/review - arguably easier given let function
Flexibility: unless you plan to take advantage of vlookup 'approximate matching' (using True flag instead of False), Index more robust in that it can handle forward and backward references in relation to the indexed column (i.e. with vlookup, index has to lie to left of the column comprising the cell to be returned)
The usual benefits assoc. with 'spill' ranges (i.e. potential for 'dynamic' range feature and automatic calc. from single cell entry)
REVISION:
The following screenshot should shed some light on references/ranges you may wish to alter for 1st formula in present response to operate as you intend within your workbook (corresponding ranges are colour-coded with clear visual link between each)...
So to apply in your case, you'd need to replace shaded/boxed ranges/references in my proposal with those you're using (as indicated - i.e. replace by H4 with your $D95 etc,..."
JB: replace final 'FALSE' with an additional iferror(Aug,-July)
This concept is clearly delineated within screenshot above.
OP: "I tried and just got N/A"
As link in opening line provides evidence of two alternative solns. working error-free, presume 'n/a' result of incorrect application...

Using daily assistance registers to know if personal is currently on the office

I would like to make a column in which a color/icon indicates that the person is currently on the office or he/she is out due to multiple reasons. I have the following columns in a excel sheet to register the absences:
Employee name - Initial date(of absence) - end date(of absence) - Type of absence - Days
Example: John - 2/16/2018 - 2/16/2018 - sickness- 1
What I would like to know is that if there's a way to use =TODAY() formula and compare it with the list and put in a column a certain color/sign depending if the person is currently absent. For example, having a column right beside the persons name that is named status and has this characteristic.
Maybe this is not possible in excel, or I should change the method of entering data. I'm open to opinions on ways to improve this system and answering doubts about the problem.
Thanks.
Create a column with this formula =IF(AND(TODAY()>=B2,TODAY()<=C2),-1,0). This will show -1 if the person is out today.
Then use conditional formatting to get your color.

Excel Data Validation AND OR with Range

=IF(OR(AND(A11="3061 - Mexico"),AND(A11="3062 - Brazil")), "Mandatory","Optional")
is already working, however, if I put it in range
=IF(OR(AND(**A11:A199**="3061 - Mexico"),AND(**A11:A199**="3062 - Brazil")), "Mandatory","Optional")
Please, give more information to us.
I'm putting this like anwser because is too large to put in comments. But this will be a anwser if you want to know if any cell has the values:
Try something like this:
=IF(AND(IFERROR(VLOOKUP("3061 - Mexico"; A11:A199;1;FALSE);"") <> "3061 - Mexico";IFERROR(VLOOKUP("3062 - Brazil"; A11:A199;1;FALSE);"") <> "3062 - Brazil");"Optional";"Mandatory")
If you want to know if all cells have the value you will need to do the same, but put the others possibles values inside the IF, and use OR instead the AND function (We can think a little bit more if that is the case).

Resources