I'm not sure what excel function to use.
I have two columns 'asset tag' and 'computer name'. Both unique values. The asset tag has a name like '11111' the computer name has a name like 'AA-11111-BB'.
I need a formula to output every asset that is also in the computer name column into its own column.
As you see the asset tags name is inside the computer name between characters.
I don't know how to tie these two columns together when their names are not exactly the same.
IS the a wildcard if statement formula for two columns to accomplish this. Please see my screenshot as well.
Something like this might work if you will always have 5 numbers for PC name and it will either be in the middle or at the end of the string.
Have this formula reference the first computer name cell:
=IF(ISNUMBER(RIGHT(B1,2)),RIGHT(B1,5),VALUE(MID(B1,4,5)))
(this will return the Asset tag without all the extra characters)
Then to match them, you can do a vlookup to return the asset class (column P in example below is the same cell as referenced above, column A is your asset class number).
IFERROR(VLOOKUP(A1,P1:P3,1,0),"")
This may require some clean up if you have duplicates, but this should get you started.
Related
I wish to either automatically add code as I create an Excel macro, or if necessary manually insert the code into an existing macro: Construct email addresses in a column, from another column whose cells contain firstname lastname. Example: John Smith in column A becomes JSmith#aol.com in column B. The mailbox name is always the same, of course. The code will process all the rows in the column.
So:
=left(A1,1)&mid(A1,find(" ",A1,1)+1,20)&"#aol.com"
I have just checked the order of the arguments in mid() and it works.
Note if there are double barreled names then you have to consider that.
You may try in this way as well, if there is only FIRST NAME & LAST NAME,
• Formula used in cell B2
=CONCAT(LEFT(A2),REPLACE(A2,1,FIND(" ",A2),""),"#aol.com")
Before I received these solutions, I first used Data > Text to Columns to split the name; then I used the following successfully (I substituted "[domain]" for security purposes): =LOWER(LEFT(J1)&K1&"#"&"[domain].com")
I may try these solutions so as to save the Data step. Note: I believe all our logins are only two names.
I need to update hundreds of cells, and that would be trivial automating, but I am not being able to make it work.
I have a list like the following:
And, in a different tab, a list I have to populate with values above (in B) based on the appearance of the twitter handle in other column.
The names are within a long text string (all of them begin with #), and it is not possible to re-order the list based on those names. Also, there are more names than values, so some cells will remain blank.
Is there a way I can write a formula that writes the values of the first list into the second one if the name in column A in that row is contained within the adjacent string?
Thanks!
You can refer to this sample formula (Same sheet was used):
=arrayformula(if(C2:C<>"",iferror(vlookup(REGEXEXTRACT(C2:C,"\B\#\w+"),A2:B,2,false),""),""))
What it does?
Use array formula to loop column C values
Extract the twitter name (string that starts with #) using Regexextract()
Use the extracted #twittername as search key to get the connections value using vlookup()
Output:
Since we don't have access to the spreadsheet, I can't know for sure what the line-break character is within the Col-A cells of your second sheet. And using this line-break character is important, since Twitter handles may use some non-alphanumeric characters such as the underscore and others which are not included in such REGEX notation as \w. I'm assuming here that the line-break character is CHAR(10) from the ASCII chart.
I also don't know the name of your first sheet; so here, I've just written it as Sheet1. You'll need to replace that with your actual sheet name, remembering to place it in single quotes if it contains anything but alphanumeric characters (e.g., 'Data Sheet').
That said, delete everything from Col-B in your second sheet (including the header "Connections") and place the following formula in cell B1 of that second sheet):
=ArrayFormula({"Connections"; IF(A2:A="",, IFERROR(VLOOKUP(REGEXEXTRACT(SUBSTITUTE(A2:A,CHAR(10),"~"),"#[^~]+"),Sheet1!A:B,2,FALSE)))})
I have a couple of different large lists of equipment on seperate worksheets I am trying to consolidate. The first sheet "List" contains multiple columns of information, including one for the area it will be relocated to. Another sheet, "Locations," contains the three areas where each piece of equipment will be relocated to, seperated in to 3 columns; at the top of each column are the names of the locations 2500, 2900, and Term. The issue is, the Equip# from the "List" sheet only partially matches the names on the "Locations" sheet.
List
Locations
As you can see above, A2203-76 under Equip# only partially matches A2203-76 20% NAP TANK AGITATOR.
This is the formula I am using {=INDEX(Locations!$A$2:$C$2,,MIN(IF(Locations!A3:C151="A2203-76",COLUMN(Locations!A:C),0)))}. This unfortunately will only return the first column value, which is 2500. What should happen is: First, on the List sheet, the New Gear Location cell should check the Equip# cell in the same row, after retrieving the Equip# it should go to the Locations sheet and search for a partial match to what it retrieved from the Equip# cell. After finding a partial match, it should look at the column the match was found in and return one of the 3 cell values from the top "2500, 2900, or Term" based on what column it was found in and fill this value in the cell on the List page that the formula was entered in to.
Another issue, which makes me think this may not be possible, is there are also instances of A2203-75. So I question if excel has the ability to apply I guess "weights" to different partial matches. What I am getting at is, if I applied some function to partially match A2203-76 to something on the other page, would it just stop at A2203 and pick the A2203-75? Or would it look at the whole string first and find the correct instance? Maybe my thinking is wrong, but if you could offer any help I would appreciate it.
Is this what you mean?:
=INDEX(Locations!$A:$B,MATCH(List!$A2&"*",Locations!$C:$C,0),COLUMNS($A:A))
Paste this formula in List!B2 and drag right, down.
It searches for your search text followed by wildcard *.
!! Please note that this will return the first match.
If you are searching for A2203-76 and your data also contains A2203-761 it will return this value if it's found prior to A2203-76 !!
I am looking to use the Index formula to return a value for a student to give me their student ID that matches surname and first name. I have a formula that works but the issues is that I am using data from two different data sources and the spelling for some names is different. I have attempted to use the left function to only look for the first couple of letters but my understanding of this function means I am only getting NA.
This is the code that works for most students
=INDEX('Student Details'!C2:'Student Details'!C146,MATCH(1,('Student Details'!E2:'Student Details'!E146=Consolidated!B2)*('Student Details'!G2:'Student Details'!G146=Consolidated!C2),0))
This is my attempt at adding the left function to the fourmula
=INDEX('Student Details'!C12:'Student Details'!C156,MATCH(1,('Student Details'!E12:'Student Details'!E156=Consolidated!B12)*('Student Details'!G12:'Student Details'!G156=LEFT(Consolidated!C12,3)),0))
I am importing data from our schools student management system as well as an online report which pulls data from a different data set and this data has exact legal names wheres as the other data has name preferred.
edit* I need the surname and first name as we have a lot of students with the same last name
As an easy solution I'd suggest simply inserting a helper column in sheet Consolidated. Cell D2 in Consolidated for example would have the following formula (just copy the formula down to match you complete dataset):
=LEFT(C2,3)
Your updated INDEX & MATCH formula would look like this (please note that sheet & cell references can be used in this shortened version):
=INDEX('Student Details'!$C$2:$C$146,MATCH(1,('Student Details'!$E$2:$E$146=Consolidated!$B2)*('Student Details'!$G$2:$G$146=Consolidated!$D2),0))
You should also use absolute cell references for referencing the dataset.
I have a bunch of data that consist of Id Number and Names.
Image 1
{=IF(ISERROR(INDEX($A$2:$B$12;SMALL(IF($A$1:$A$16=$E$1;ROW($A$1:$A$12));ROW(1:1));2));"";INDEX($A$1:$B$12;SMALL(IF($A$1:$A$16=$E$1;ROW($A$1:$A$12));ROW(1:1));2))}
Previously (Image 1) I successfully able to return multiple value with A Name value from column Names that consist of only one name. I am using Index function Array formula to solve this problem.
But,I got stuck when I have multiple names in that Names column. What I want to do is to return multiple value of Id Number that consist of a multiple names separated by 'comma' inside Names column without modifying that column. Expected result is shown in Image 2.
Image 2
The problems are :
I want to get the value from the ID Number column based on Names
column that contain a name inside
I want to automatically get multiple values just like displayed in
Image 1
If there're two ID Number value that is the same, it will be deleted or not be shown in the result.
I don't mind any kind of method you guys will purposed to me. I will appreciate any solutions you offered. Thank you very much.
You can use
=IFERROR(INDEX($A:$A,SMALL(IF(ISNUMBER(FIND(E$1,$B$2:$B$11))*(COUNTIF(E$1:E1,$A$2:$A$11)=0),ROW($B$2:$B$11)),1)),"")
entered as an array formula using CtrlShiftEnter
or
=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($B$2:$B$11)/(ISNUMBER(FIND(E$1,$B$2:$B$11))*(COUNTIF(E$1:E1,$A$2:$A$11)=0)),1)),"")
entered normally.
EDIT
#Ron Rosenfeld is absolutely correct that the formulas as they stand would match (for example) Jo as well as John, although the effect is mitigated somewhat by the fact that they are using case-sensitive find with a capital letter at the beginning of each name (so Ange wouldn't match Hanger).
The modified formulas would be
=IFERROR(INDEX($A:$A,SMALL(IF(ISNUMBER(FIND(","&E$1&",",","&$B$2:$B$11&","))*(COUNTIF(E$1:E1,$A$2:$A$11)=0),ROW($B$2:$B$11)),1)),"")
and
=IFERROR(INDEX($A:$A,AGGREGATE(15,6,ROW($B$2:$B$11)/(ISNUMBER(FIND(","&E$1&",",","&$B$2:$B$11&","))*(COUNTIF(E$1:E1,$A$2:$A$11)=0)),1)),"")