Format Cell Contents - excel

I'm working from a software that stores some entity IDs and need to format them in a very specific way. I'll try to be as specific as possible.
Each cell has to be 6 digits long.
1st digit can be either alphabetical or numeric.
2nd, 3rd, and 4th digit can only be numeric.
5th and 6th digit can only be alphabetic.
I have some of the following IDs (and what i need them to look like) for example (substituting - for spaces):
G11R(G-11R-), J6R(J--6R-), I6AR(I--6AR), 1516B(1516B-), 414(-414--).
I don't even know where to begin on something like this, I've searched the forum but I'm also not even sure exactly what you would call this.
Any help, even just a point in the right direction would be greatly appreciated.
Thanks

Because I wanted to see if I could do it with a formula:
=LEFT(IF(OR(ISERROR(--LEFT(A1)),AGGREGATE(14,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1)-AGGREGATE(15,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1)=3),LEFT(A1)," ") &REPT(" ",MAX(2 - (AGGREGATE(14,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1)-AGGREGATE(15,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1)),0)) & RIGHT(MID(A1,AGGREGATE(15,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1),AGGREGATE(14,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1)-AGGREGATE(15,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1)+1),3) & MID(A1,AGGREGATE(14,6,ROW(INDIRECT("1:" & LEN(A1)))/(ISNUMBER(--MID(A1,ROW(INDIRECT("1:" & LEN(A1))),1))),1)+1,LEN(A1))&" ",6)
Just to show, I replaced all the spaces in the formula with -.

Related

Convert 5 cells with 1s and 0s into a single array like {1,0,0,1,1} in Excel

Alright, in excel I'm converting a 5 bit binary code into a single array in the form of a string. Cells D62, D64, D68, D70, and D72 all have either a 1 or a 0, and I'm requesting help to convert these cells with numbers in them into an array by using a formula. I need the output to cell D59.
=IF(ARRAY(D62:D70)={1,1,1,0,0},1,0)
something like that
To change the 5 cells values to a 5 bit binary letter just concatenate:
=CHAR(BIN2DEC(A1&A2&A3&A4&A5)+64)
If one has CONCAT:
=CHAR(BIN2DEC(CONCAT(A1:A5))+64)
In D59 enter:
="{" & D62 & "," & D64 & "," & D68 & "," & D70 & "," & D72 & "}"

How to put "/" on a date values?

what excel formula should I use to change a date value that is numbered into a date format. For example
5312018 into 5/31/2018
or 10202018 into 10/20/2018
See also image example below.
You could try:
=IF(LEN(A2)=8,LEFT(A2,2),LEFT(A2,1)) & "/" & IF(LEN(A2)=8,MID(A2,3,2),MID(A2,2,2)) & "/" & RIGHT(A2,4)
Results:

Multiple vlookups in the same cell, with their values coming from different drop down lists. How do I get a blank when one of the dropdowns isnt used?

Title pretty much says it all.
I have multiple dependent drop down lists (A2:H2)
Each time you select something, a corresponding number is entered into I2, with the numbers being separated by commas.
However, you MUST select a value from each drop down list or else you get #N/A error.
How can I make excel just "skip" or "ignore" missing values?
Thank you!
P.s.
I have already tried the IFERROR and IFNA commands but they do not work. I either get "TRUE" , with no numbers at all. And I also don't know how to make this work for about 6 different vlookups.
UPD:
=VLOOKUP(A8,'New Categories'!A$3:B19,2,FALSE) &", " &
VLOOKUP(B8,'New Categories'!A$3:B206,2,FALSE) &", "&
VLOOKUP(D8,'New Categories'!A$72:B$83,2,FALSE)&", "&
VLOOKUP(E8,'New Categories'!$A$72:B$83,2,FALSE)&", "&
VLOOKUP(F8,'New Categories'!$A$59:B$68,2,FALSE)&", "&
VLOOKUP(G8,'New Categories'!$A$59:B$68,2,FALSE)&", "&
VLOOKUP(H8,'New Categories'!$A$59:B$68,2,FALSE)
Use this one:
=IFERROR(VLOOKUP(A8,'New Categories'!A$3:B19,2,FALSE), "") &
IFERROR(", " & VLOOKUP(B8,'New Categories'!A$3:B206,2,FALSE), "") &
IFERROR(", " & VLOOKUP(D8,'New Categories'!A$72:B$83,2,FALSE), "") &
IFERROR(", " & VLOOKUP(E8,'New Categories'!$A$72:B$83,2,FALSE), "") &
IFERROR(", " & VLOOKUP(F8,'New Categories'!$A$59:B$68,2,FALSE), "") &
IFERROR(", " & VLOOKUP(G8,'New Categories'!$A$59:B$68,2,FALSE), "") &
IFERROR(", " & VLOOKUP(H8,'New Categories'!$A$59:B$68,2,FALSE),"")

Move Two characters from beginning to end of string

I have an Excel 2010 document which has hundreds of rows each with a cell as below:
(without the quotes, of course)
"XX - A Name of Something Here"
Which I need to change to:
"A Name of Something Here (XX)"
I'm trying to figure out the best way to accomplish this and could really use some assistance.
Try this:
=RIGHT(A3, LEN(A3) - 5) & " (" & LEFT(A3, 2) & ")"
which means
all but the last 5 chars of the string, counting from right to left
5 because XX space dash space is 5 chars long
a space and an open parenthesis
the leftmost two chars ie XX
a close parenthesis.
This formula will work given your example
=MID(A1&" ("&A1,5,LEN(A1))&")"
How about:
=MID(A1,3,9999) & "(" & LEFT(A1,2) & ")"
but how about the dash??
=RIGHT(A1, LEN(A1) - 5) & " (" &LEFT(A1, 2) & ")"
This will work too - I like "concatenate" since I don't need to keep track of the &'s
=CONCATENATE(RIGHT(A3,LEN(A3)-5)," (", LEFT(A3,2),")")
So many fun ways to do the same thing...

Excel Formula with concatenate

I am trying to generate a customer number using the first three letters of the customers last name, the first name initial and middle initial, followed by the last four of their phone number. How would I do this? All I need is the formula.
First_Name Middle_Initial Last_Name Street_Address City State Zip Phone
Nathaniel E. Conn 6196 View Ct Lancing TN 37770 567-273-3956
Something like this (assuming a table with [structured-references], fill in the actual cell names if not):
=LEFT([LastName] & "---", 3)
& LEFT([FirstName] & "-", 1)
& LEFT([MiddleInitial] & "-", 1)
& RIGHT([PhoneNumber] & "----", 4)
I have used dashes ("-") to fill in any spaces where the field might be smaller than the number of characters you need from it. You can change them to any fill character that suits you.
Well, it depends on if each piece of data has its own column, looks like it does.
You can use the left/right functions to parse the data out of your columns.
=CONCATENATE(RIGHT(C1,3) & LEFT(A1,1) & LEFT(B3,1) & RIGHT(H1,4))
I would do:
=MID(CELL_LAST_NAME;1;3)&MID(CELL_FIRST_NAME;1;1)&MID(CELL_MIDDLE_NAME;1;1)&MID(CELL_PHONE;LEN(CELL_PHONE)-3;4)

Resources