I have a spreadsheet of all of the site-to-site VPN tunnels we have in production. I'm attempting to create a table like the following in Excel, where Source and Network are already known, and Destination is an output of the two. Essentially in the Network Column there are 2 (and no more than 2) instances of each network address. I would like to create a third column (the Destination OUTPUT) column to output the other half of a matching pair, so to speak. I feel like this should be some sort of VLOOKUP but I cannot for the life of me figure out how to format it. The goal would be to do it without needing to create another helper column or anything like that. I know I could use some functionality in Kutools to do it, but I'm trying to keep the sheet dynamic rather than relying on a macro that makes a static edit to the sheet.
Source
Network
Destination (OUTPUT)
Ashburn
1.1.1.0
San Jose
Dallas
4.4.4.0
Seattle
Vancouver
2.2.2.0
San Jose
Frankfurt
3.3.3.0
Chicago
San Jose
1.1.1.0
Ashburn
Chicago
3.3.3.0
Frankfurt
San Jose
2.2.2.0
Vancouver
Seattle
4.4.4.0
Dallas
Thanks for any help you can provide!!
EDIT: So I'm trying to use INDEX() and MATCH() for this now and I think I'm getting closer...
=INDEX($A:$B,MATCH(B2,B:B,0),1) returns the first match, which is just itself. How might I modify my MATCH statement to select the second match? And will this search the entire list and then start from the beginning again until it finds the second match? Or would it only work when ordered in a certain way?
Thanks!
If you have Office 365:
C2: =FILTER($A$2:$A$9,(B2=$B$2:$B$9)*(A2<>$A$2:$A$9))
You can also use, in any version of Excel: (as suggested by #JvdV)
C2: =LOOKUP(2, 1/(($B$2:$B$9=B2)*(A2<>$A$2:$A$9)),$A$2:$A$9)
(Normally entered)
This will work in all versions of Excel, entered as an array formula if you don't have dynamic arrays:
=INDEX($A$1:$A$9,MAX(IF((B2=$B$2:$B$9)*ROW($B$2:$B$9)=ROW(),0,(B2=$B$2:$B$9)*ROW($B$2:$B$9))))
Trying to combine and IF + Concatenate together. I'm running a report right now for my company where we grab samples from different water locations, but due to COVID-19 we aren't allowed in some specific locations and therefore have to get a water sample from a nearby hydrant.
I have all the locations and hydrants in one spreadsheet as data, and in my main tab I have an empty cell where someone may put (YES/NO) and if they put YES then another cell will fill with the hydrant name along with the location.
My issue is I have to have both this data combined in one static cell if "YES" is put, for example...
Location: LOC-3 John Street
Hydrant used?: YES
Hydrant (auto filled): LOC-3 HYDRANT 3333
Full location name (if YES): LOC-3 John Street LOC-3 Hydrant 3333
Full location name (if NO): LOC-3 John Street
This is the code below that I'm using in order to return the location name, can't figure out where or how to throw concatenate in there without getting an error back. Thank you in advance for your help.
=IF(OR((AND((A6<>""),(D6<>""))),(AND((B6<>""),(D6<>"")))),IF(A6="",B6,A6),"")
(Not a complete answer, but too large for a comment)
Your first part of your logical expression is quite large, let's have a look:
[(a6<>"") AND (d6<>"")] OR [(b6<>"") AND (d6<>"")]
=[(a6<>"") OR (b6<>"")] AND (d6<>"")
=[(a6&b6) <> ""] AND (d6<>"")
Where a6&b6 has the Excel meaning (concatenation of a6 and b6).
This is already a significant simplification of your formula. You might try to simplify even further and go on from there.
I have a problem to extract the suburb from a address.
For example, the dress is "143 Stephanie St, Upper Kedron, QLD, 4055."
How to set up a formula to extract the buburb, Upper Kedron, from the address?
I really appreciate your review :)
This will extract second word separated by comma:
=TRIM(MID(SUBSTITUTE(A1,",",REPT(" ",255)),255,255))
You will have problem if Upper Kedron is not 2nd word like for example:
143, Stephanie St, Upper Kedron, QLD, 4055 (this will extract Stephanie St).
So if you have cases that formula doesn't work give us more inputs.
As per the previous answer, looks like your suburb can be in any position. So the best way is to split the address to multiple columns and then choose a column of your suburb.
=TRIM(MID(SUBSTITUTE($A1,",",REPT(" ",999)),1+((COLUMN(A1)-1)*999),999))
How do I extract text between two commas in Excel?
92 4th Street North, Providence, RI 02904
In this case, how would I extract "Providence" substring using simple Excel formulas (LEN, FIND, LEFT, RIGHT, etc)?
Try the following formula.
=MID(A2,FIND("^",SUBSTITUTE(A2,",","^",1))+1,FIND("^",SUBSTITUTE(A2,",","^",2))-FIND("^",SUBSTITUTE(A2,",","^",1))-1)
Try the following formula
=LEFT(RIGHT(A1,FIND(",",A1)),FIND(",",RIGHT(A1,FIND(",",A1)))-1)
Considering your data is on A1
#RAJA-THEVAR's formula worked very well for me with a list of over 2500 addresses, as long as the address only contained two commas. With an address like "100 Washington Street, Suite 225, Denver, CO 80220" it returns "Suite 225." I used the following formula to identify and addresses that contained more than two commas:
=LEN(A1)-LEN(SUBSTITUTE(A1,",",""))
Many of these many-comma addresses had strange formats or information, and I found it better to fix them by hand.
Currently I am working with a spreadsheet where I have to collect addresses of UK business Directors. Some of the directors have multiple addresses. UK zip code consist of two segment and I have to ignore the address where the first segment of zip code starts with W1 , SW1, EC1, EC2, EC3 & EC4 and ends with character not number because those are generally industrial address. For example Please check the following addresses where the addresses starts with W1 , SW1, EC1, EC2, EC3 & EC4 and ends with letter and I have to ignore collecting those.
3RD FLOOR 207 REGENT STREET, LONDON, W1B 3HH
42, CHARTERHOUSE SQUARE, LONDON EC1, EC1M 6EU
5, WESTMINSTER GARDENS, LONDON, MARSHAM STREET, SW1P 4JA
160, QUEEN VICTORIA STREET, LONDON, EC4V 4QQ
THE BROADGATE TOWER 20, PRIMROSE STREET, LONDON, EC2A 2RS
BAKERS' HALL 9, HARP LANE, LONDON, EC3R 6DP
Also please take note the zip codes of W11,W12 W13 and so on are not prohibited and same thing applies for the SW1, EC1, EC2, EC3 & EC4.
Now as we are working on the bulk data, its impossible to notice the zip codes when collecting the address. So I have tried with combination of various formula to highlight the first segment of those mentioned zip codes in a separate column using just right after pasting the address. In this way I can see the prohibited zip codes right after pasting the address. Although I am not successful cracking on it but I was close of it. I am just sharing the thing I have tried and looking for a compact solution from you guys.
First of I have created a separate column E where it will show the first segment of the zip code when I will paste the addresses in the column D. Here is the code which I have used:
=TRIM(LEFT(RIGHT(" "&SUBSTITUTE(TRIM(D2)," ",REPT(" ",60)),120),60))
Next I have tried to show only those values which starts with W1 , SW1, EC1, EC2, EC3 & EC4 and ends with a letter. So I have created another column F and create the formula for "SW1"
=IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), IF(ISNUMBER(SEARCH("SW1",E2)), LEFT(E2,3), ""),"")
So if I have to check for W1 , EC1, EC2, EC3 & EC4, I have to create 5 more columns with the same formula where just have to change the value of search function. This lead me to 6 extra columns and I want a compact formula for savings the space because I generally split the browser and execl in a way that's why I can copy and paste data on the spreadsheet without minimizing the spreadsheet. This saves me a lots of time. But creating six more column will make my work more time consuming as I have to check all six columns for those zip codes.
Question - 1:
I want to ask, is there any way to make a compact formula for showing my desired result in a single column only?
Question - 2:
We also have to ignore the addresses which consist the words "floor","house" & "airport". I have tried the below formula for single query:
=IF(ISNUMBER(SEARCH("Floor",D2)), "Floor", "")
Is there any possibilities combing all required formula and show the result in one column?
Update regarding Question - 1:
I have tried to combine using some other formula to show the required result. But comes up with showing only those zip code which starts with W1 , SW1, EC1, EC2, EC3 & EC4 but can't modify it to restrict those results also where the last character is a number. Here is the code:
=IF(ISNUMBER(FIND("W1",(LEFT(E2,2)),1))=TRUE,LEFT(E2,2)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("SW1",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC1",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC2",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC3",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),IF(ISNUMBER(FIND("EC4",E2,1))=TRUE,LEFT(E2,3)&IF(NOT(ISNUMBER(VALUE(RIGHT(E2,1)))), RIGHT(E2,1),""),""))))))
Your formula in column E could combine the last character is not a number with the parse of the first section of the postal code with something like the following.
=IF(ISERROR(--RIGHT(A2)), TRIM(LEFT(TRIM(RIGHT(A2, 8)), 4)), "")
That makes the parsing dependent on a British postal code being either 7 or 8 characters wide with the first section being either 3 or 4 characters. The 'wandering' space is either picked up and trimmed off or not picked up at all depending on the length.
With column Y listing the prefixes of the postal codes to be ignored and column Z (in any worksheet) devoted to a cross-reference list of exceptions like the following:
Note that each of the entries in the Ignore list and the Exceptions list all carry the wildcard asterisk as a suffix. This is necessary to deal with staggered lengths of the comparisons to be made.
The formula used for a Conditional Formatting Rule for A2:E999 would be,
=AND(SUMPRODUCT(COUNTIF($E2, $Y$2:$Y$7)), NOT(SUMPRODUCT(COUNTIF($C2, $Z$2:$Z$4))))
This resolves TRUE for any postal that should be ignored and is not in the exception list.
The cross-reference tables of ignores and exceptions may benefit from becoming a named range for easy reference. You could use a dynamic range definition for the Applies to: of something like:
=Sheet1!$Y$2:INDEX(Sheet1!$Y:$Y, MATCH("zzz", Sheet1!$Y:$Y))
=Sheet1!$Z$2:INDEX(Sheet1!$Z:$Z, MATCH("zzz", Sheet1!$Z:$Z))
Here's a formula to tell you whether the first word after the last comma ends with a number.
=ISNUMBER(NUMBERVALUE(RIGHT(LEFT(TRIM(RIGHT(SUBSTITUTE(B1,",",REPT(" ",LEN(B1))),LEN(B1))),SEARCH(" ",TRIM(RIGHT(SUBSTITUTE(B1,",",REPT(" ",LEN(B1))),LEN(B1))))-1))))