How do I reference cell dynamically in Microsoft Excel - excel

I need to combine string values from (fixed column, variable row) + (fixed column, fixed row) how do I do this?
for example:
| ONE | TWO | THREE
ONE | ONE-ONE | TWO-ONE | THREE-ONE
TWO | ONE-TWO | TWO-TWO | THREE-TWO
THREE | ONE-THREE | TWO-THREE | THREE-THREE*
Any help would be appreciated, thank you!

Assuming top is row one and left is column A for your example, put the following in B2 drag across and down to fill the array.
=CONCATENATE(B$1,"-",$A2)

Related

Determine whether 4th character in cell is numeric or text

I'm trying to find a way to determine if the 4th character in a cell is either a letter or a number. I found a similar thread but their solution isn't working for me.
My example:
| A Column | B Column to return |
| -------- | -------------- |
| BKGB1000 | BKGB |
| BKG41000 | BKG |
=IF(ISNUMBER((LEFT(A1,4))),LEFT(A1,3),LEFT(A1,4))
I have also tried
=IF(ISNUMBER(MID(A1&" ",4,1)),3,4)
The above just isn't working. It keeps returning all 4 characters, so in the 2nd row it returns BKG4 instead of just BKG. Any help would be greatly appreciated!
=IF(ISNUMBER(MID(A2,4,1)*1),"number","letter")
The MID results in text. Multiplying it results in a number provided the character is a number.
Solution. Thanks for the guidence P.b
=IF(ISNUMBER(VALUE(MID(A2&" ",4,1))),LEFT(A2,3),LEFT(A2,4))

Excel - Forumla to seacrh for mutliple terms and show the matching term

I have the challenge that I need to search in Excel for multiple terms and to get the result back for each cell which of the different terms has matched.
I know there is a formula combination to search for multiple terms but this will not give me the matched term back. The exampel below gives only a "0" or "1" back.
=IF(ISNUMBER(SEARCH({"TermA","TermB","TermC"},A1)),"1","0")
| | A | B |
| 1 | This is TermA | TermA |
| 2 | Some TermB Text | TermB |
| 3 | And TermA Text | TermA |
| 4 | another TermC | TermC |
Background I have to do some normalization of the values and look therefore for some forumla which can identify the values and list the match. The values which are used to search for should be later on another page so it can be easily extended.
Thank you for some hints and approaches which will put me into the right direction.
To return all matching terms:
=INDEX(FILTERXML("<t><s>"&SUBSTITUTE(A1," ","</s><s>")&"</s></t>","//s[.='TermA' or .='TermB' or .='TermC']"),COLUMN(A1))
Wrap in an IFERROR() if no match is found at all.
If one has ExcelO365 and you refer to a range, things got a lot easier:
Formula in E1:
=TRANSPOSE(FILTER(C$1:C$3,ISNUMBER(FIND(C$1:C$3,A1))))
=INDEX(FILTER(C:C,C:C<>""),MATCH(1, COUNTIF(A1, "*"&FILTER(C:C,C:C<>"")&"*"), 0))
For use in office 365 version. If previous version replace FILTER(C:C,C:C<>"") with C$1:C$4 for your example or whatever your range of search values may be. Table reference is also possible.
The formula searches for the first match in your list of values if the text including your term contains a matching value anywhere in that text. It returns the first match.

Substracting part of cell

So lets say that in one row i have in 2 cells some data and I want to extract the data after the second "_" character:
| | A | B |
|---|:----------:|:---------------------:|
| 1 | 75875_QUWR | LALAHF_FHJ_75378_WZ44 | <- Input
| 2 | 75875_QUWR | 75378_WZ44 | <- Expected output
I tried using =RIGHT() function but than i will remove text from this first cell and so on, how can i write this function? Maybe I would compare this old cell and than to do if the second row is empty because maybe function deleted it to copy the one from first? No idea
Try:
=MID("_"&A1,FIND("#",SUBSTITUTE("_"&A1,"_","#",LEN("_"&A1)-LEN(SUBSTITUTE("_"&A1,"_",""))-1))+1,100)
Regardless of the times a "_" is present in your string, it will end up with the last two "words" in your string. Source
Use following formula.
=TRIM(MID(A1,SEARCH("#",SUBSTITUTE(A1,"_","#",2))+1,100))

Can't return multiple values of same input using VLOOKUP/INDEX/MATCH

I've tried searching online to solve this problem but cannot seem to find an appropriate solution to this problem I have.
I am trying to find all of the MAC addresses connected to each Switch in a network.
I am doing this in excel and have the following sample data:
+--------------+------------+--------+
| Mac Address | Switch | Port |
+--------------+------------+--------+
| 00144f601fdf | 6553DC-HA1 | Gi4/42 |
| 00144f601fdf | 6554DC-LA1 | Gi6/1 |
| 00144f601ff2 | 1123DC-MA1 | Gi8/34 |
| 00144f601ff2 | 6554DC-LA1 | Gi6/1 |
| 00144f601ff3 | 1123DC-MA1 | Gi8/35 |
| 00144f601ff3 | 6554DC-LA1 | Gi6/1 |
| 00144f685d38 | 1123DC-MA1 | Gi8/44 |
| 00144f685d38 | 6554DC-LA1 | Gi5/1 |
+--------------+------------+--------+
I have tried using VLOOKUP but obviously that only returns the first value, i've tried playing around with INDEX and MATCH but I haven't got anywhere helpful.
Ideally I'd like to see:
00144f601fdf = 6553DC-HA1
= 6554DC-LA1
00144f601ff2 = 1123DC-MA1
= 6554DC-LA1
And so on... any help on this matter or suggestions for potential solutions would be greatly appreciated!
Your example "I'd like to see" shows all of the switches for each mac address, but your request is for "all of the MAC addresses connected to each Switch."
Assuming your example is what you want to see, then you can insert a column in Excel between the "MAC Address" and "Switch" columns and use a formula in the new column to show MAC addresses only when they change.
If the rows are already sorted by MAC Address, and MAC Address is column A, the formula is
=IF(A2=A1,"",A2)
Just paste that in each cell of the new column and it will how the MAC Address entry only the first time it appears - the result will look like your example above.
fyi if you want a more compressed result, use unique() and transpose() with (optionally) concatenate(). Example at this Google sheet.
If the data is structure like in your example I recommend mike's answer.
If it is unordered you can use the following approach which will always return two results:
In D1: =VLOOKUP(A12,$A$2:$C$9,2,FALSE) (fairly obvious)
In D2:
=VLOOKUP(A12,
OFFSET($A$2,
MATCH(A12,$A$2:$A$9,0),
0,
COUNTA($A$2:$A$9) - MATCH(A12,$A$2:$A$9,0),
2),
2,
FALSE)
This offsets the range to after the first matched MAC address and resizes it to the end of the supplied range (In case you have more stuff below) and runs the VLOOKUP on that.

Looking multiple values on multiple columns in excel

I have a table where each person has several "Job" columns. I need to find all the employees who has a specific value ("Actor") in one of their "Job" columns.
I thought about doing HLookup on multiple columns, but Lookup functions only returns the first match (and I'm not sure I can use it on multiple columns). I also tried Pivot Tables, but all I got is aggregation, not the exact matches. How can I solve it?
For example, from the sample data below, when looking for "Actor", I would like to get both "John, Doe" and "Todd, Dude"
Sample data:
Id | First Name | Last Name | email | Job1 | Job2 | Job3 | Job4
-----------------------------------------------------------------------------------
1 | John | Doe | jd#i.com | Actor | Photographer | Producer |
2 | Todd | Dude | sd#i.com | Lights | Actor | |
3 | Janis | Joplin | jj#i.com | Singer | | |
Assuming the table as you give it is in A1:H4 (with headers in row 1), and that you put e.g. "Actor" in J1, this array formula** in J2:
=IFERROR(INDEX($B$2:$B$4&" "&$C$2:$C$4,SMALL(IF($E$2:$H$4=J$1,ROW($E$2:$H$4)-MIN(ROW($E$2:$H$4))+1),ROWS($1:1))),"")
Copy down until you start to get blanks. The formula may also be copied across to give results for other professions listed in K1, L1, etc.
Regards
**Array formulas are not entered in the same way as 'standard' formulas. Instead of pressing just ENTER, you first hold down CTRL and SHIFT, and only then press ENTER. If you've done it correctly, you'll notice Excel puts curly brackets {} around the formula (though do not attempt to manually insert these yourself).
I have no idea, how to it in one formula. All lookups and match returns only first reference. You could add column jobActor --- true if one of the jobs is Actor and then create pivot --- filter on jobAll, row names is person names.
Maybe advanced filter could be the way how to do it.

Resources