Create Custom Numbering Format Excel - excel

I need to create a formula or custom numbering format that references the Requirement Type returns the requirement ID FR,SC, Etc and numbers the column FR001, FR002, FR003... or for SC001, SC002, SC003... for all of the requirements.
How is this possible?

In my example I created one table for the codes (insert > table) and one for your requirments. To make the formula less complicated I added a helper column for the code which uses a Index/match formula to retrieve the code based on the type. Within the ID column CountIf is used to get the "running" number".
Code =INDEX(tblCodes[Requirement],MATCH([#Type],tblCodes[RequirementType],0))
ID =[#Code] & TEXT( COUNTIF($E$3:$E3,[#Code])+1,"000")

Related

Excel: Dependant Data Validation Listing values from table with criteria without Macro

I would like to create a data validation field that draws values from a table, but only those values where a corresponding value matches a cell reference: the Month
Ideally this should be done dynamically, rather than having to create multiple named ranges.
I have included an image highlighting the target values I want to pull for January.
Edit: I am exploring using the FILTER formula, but no luck so far.
Edit 2: I got FILTER to work to provide the set of values I'm looking for, but it doesn't seem to want to work as data validation.
=FILTER(tblDate[Date],(tblDate[Month]=E2),"")
As has been commented, the Data Validation list will not accept FILTER, but it will accept other formulae.
In the example, you can set the List validation as:
=OFFSET(B2,MATCH(F2,A2:A18,0)-1,0,COUNTIF(A2:A18,F2))
keying off cell F2 for the value of the month.
NB: This works if the months are ordered (as in the given data). Also note that the List formula doesn't seem to like the Table[] syntax, so you have to put the ranges in as R1C1 format.
Alternatively you can use FILTER() for non-ordered data but put the results in a hidden column (Column H in the example below) on the spreadsheet. It is not as neat, but is more flexible, and allows the Table[] syntax.
eg
H2 = FILTER(Table1[Date],Table1[Month]=F2)
List Range
=$H$2#
(The # uses the result of the FILTER array function from cell $H$2: Hat-tip to #Ike)

Highlight/extract rows that consist of a specific value

Im not sure if this can be done in excel but here goes.
Im looking for a way to either extract/highlight a list of OrderID & with its related products only if the OrderID has Product "A" while ignoring the other orderID's that does not have A.
I have tried using IF statements to detect Product "A" but it could not check the subsequent OrderID rows. I also thought of using Concatenate/Textjoin but couldn't make it work.
Screenshot of sample data:
Result im trying to achieve
It should only highlights/extract the OrderID's 6613,7557 and 3396 (along with the other products values) as these OrderID's has product "A". While it ignore other OrderIDs that does not have Product "A" (eg. 4519,7601,2113,9880)
Edited: attached 2 pictures to differentiate sample and results
To highlight use below formula in conditional formatting.
=AND(ISNUMBER(MATCH($A2,$E$2:$E$10,0)),$B2="A")
If you want to filter data with Product A then use below formula.
=IFERROR(INDEX($A$1:$B$17,AGGREGATE(15,6,ROW($A$1:$A$17)/($B$1:$B$17="A"),ROW(1:1)),COLUMN(A$1)),"")
If you have Office365 then use Filter() formula.
=FILTER(A1:B17,B1:B17="A")
If you have O365:
F2: =FILTER($B$2:$C$17,COUNTIFS($B$2:$B$17,$B$2:$B$17,$C$2:$C$17,"A"))
If you have an earlier version of Excel:
=INDEX(B2:C17,
-1+AGGREGATE(
15,6,
1/COUNTIFS($B$2:$B$17,$B$2:$B$17,$C$2:$C$17,"A")*ROW(B2:B17),
ROW(INDEX($A:$A,1):INDEX($A:$A,SUM(COUNTIFS($B$2:$B$17,$B$2:$B$17,$C$2:$C$17,"A"))))),
{1,2})
Highlighting the A's can be done with simple conditional formatting (eg cell equals A)

Return array based on titles

I'm, looking for a way to return an array of text based off of titles or headers if you will. My brain isn't working today and I keep struggling to find the best method. I originally was going to have a bunch of IF statements and ran into problems, and I can't seem to figure out if Aggregate is a viable method.
Essentially if "Title 1" is selected from a drop down I would like to return the names within Title 1, and so on. If "All" is selected I would like all to populate from each title. The speed bumps I have is that some names repeat and I only want to show each name once always in alphabetical order. Can someone please get me started on how to tackle this?
In Excel O365 with the FILTER function, you can do this with a helper column (which you can hide, or position elsewhere).
I created a Table and am using structured references, but you can change to ordinary addressing if you prefer.
TitleList is a named range that includes all or your titles (presumeably you will use this for your dropdown).
For the Helper Column, I have it adjacent to your Names column with the formula:
=IF(OR(A2=TitleList),ROW(),B1)
This creates a unique number for each title.
Then, for your formula, under the dropdown, you can use:
=FILTER(Table3[Names],(Table3[Names]<>G1)* (Table3[Index]=XLOOKUP(G1,Table3[Names],Table3[Index])))
where G1 contains the dropdown
With Column B visible:
Some with O365 do not have the FILTER function. If you do not have the FILTER function, you can use:
=INDEX(Table3[Names],AGGREGATE(15,6,1/(INDEX(Table3[Index],MATCH(G1,Table3[Names],0))=Table3[Index])*ROW(Table3)-ROW(Table3[#Headers]),ROW(INDEX($A:$A,2):INDEX($A:$A,COUNTIF(Table3[Index],INDEX(Table3[Index],MATCH(G1,Table3[Names],0)))))))
EDIT
To return a non-duplicate list of ALL of the names, add ALL to TitleList and use this formula instead.
This formula makes a special case for ALL and filters out the rows that contain a Title
=IF(G1="ALL",UNIQUE(FILTER(Table3[Names],COUNTIF(TitleList,Table3[Names])=0)),FILTER(Table3[Names],(Table3[Names]<>G1)*(Table3[Index]=XLOOKUP(G1,Table3[Names],Table3[Index]))))
.imgur.com/apkHh.png

Excel: Sorting Data that is Custom Formatted to add a Prefix

Hi I have a list of Values in a table that I would like to Order, the data in the column has been compiled from three separate tables where the custom format was applied for example;
When I enter the value "2" the formatting adds the prefix "MCRY-" so the value I get is "MCRY-2".
But in another table it adds the prefix "ACCRY-"
When I copy this over into the "master" sheet the formatting is copied over to which is perfect, however when I order the column the formatting is ignored as the cell values are only the numbers and not the prefixes.
My question is, how do I get the sorting process to acknowledge the prefixes as if they are apart of the cell value?
So much so that is I have "MCRY-01", "ACCRY-01", "MCRY-02", "ACCRY-02" it will order it ACCRY and then MCRY.
I have tried special pasting as values but that doesn't work. Any help?
Thanks
I wouldn't use conditional formatting for this process. You will need to hardcode. If "2" is in A1 then put the following into B1 to get the required result
="MCRY-"&TEXT($A1,"00")
Will give you "MCRY-02"
I’ve had some ‘lulus’ but this may count as my nastiest hack ever (#CallumDS33 is basically correct).
Format the “ACCRY-“ table with "ACCRY-"#;"ACCRY-"# then proceed as normal but add a helper column in your “master” sheet with:
=CELL("format",B1)
copied down to suit, where B is assumed to be the column to be ordered. Now sort on the column to be ordered within sorting of the helper column.

Excel table default value and data validation without VBA

I have a table in Excel for tracking projects. Whenever I create a new row for the table I'd like it to auto-populate one column that the project has "Not Invoiced". I would ALSO like that this column use Data Validation to only allow either "Not Invoiced" or "Invoiced" as content.
I have been able to make both of these things work, but I cannot seem to make them work together without error! The closest I have gotten:
Put a formula in the relevant column. Have tried both the super basic ="Not Invoiced" as well as an =IF formula based on the blankness of another column. This correctly carries down each time I make a new row.
I then add Data Validation on the column which also works fine at first since my default value from my formula is one of the options, HOWEVER when the project does invoice and I select "Invoiced" I then get an error that I'm violating the above formula. From what I've read selecting something from the drop down should just replace the auto-populated formula, but that doesn't seem to happen, it gives me an error that I've violating the column's formula instead.
I've read multiple places that if you correctly order things (create table, add formula for default value, then add data validation) the above method should work, but it will not for me and I continue to get the error every time I change to "Invoiced".
you can enter the stati "Not Invoiced" and "Invoiced" into cells that are close together, e.g. $G$3 and $G$4. Then, create a named range for $G$3:$G$4, let's say "ValList" (menu: Formula / Define Name).
Imagine column A to be the controlling column, and B the status column ("Invoiced" / "Not Invoiced"). Example for cell B5:
The initial status is =IF(A5=""; ""; $G$3)
The Validation (type "List") must be controlled by a formula =IF(A5=""; " "; ValList)
Good luck!
There's a simple way to do this.
Before you start using a new table, add list data validation to the cell in the first and only row:
Invoiced,Not Invoiced
Then, in the first row of your table in that same cell write:
=IF(TRUE,"Not Invoiced";"Not Invoiced")
This will put Not Invoiced as the default value on every new row that is added to the table and also keep data validation in place. You will still have access on every new row's cell to the dropdown list stored in the initial cell's data validation list parameter.
For some reason, data validation is overwritten if you try the same IF-function approach in reference to another cell, as you described it.
One way to solve this would be to use a helper column.
You can use the data validation list for the entry column, say column A.
You can use a formula in the hidden column B with the formula =IF(A1,"Invoiced","Invoiced","Not invoiced")

Resources