How to find first unique value in a column of SKU? - excel

So I have two columns, A & B, (like below). There's 2 components to the ID, the design (CEN101A) and the size (-6).
I'm trying find the first item of each design. So in this example, I would highlight (CEN106A-6, CEN101B-6, CEN101D-6, etc.). This is so I can use them as a parent for the other sizes.
I've tried many in-built functions but nothing seems to work. Is VBA able to easily find these values?

#BigBen is right, this is fairly easy if you can find what the actual design code is. For good measure I'd use a running count and add the hyphen back including a wildcard into the COUNTIF():
Formula for conditional formatting rule on range A2:A7:
=COUNTIF(A$2:A2,#TEXTSPLIT(A2,"-")&"-*")=1
Without TEXTSPLIT(), use a combo of LEFT() and FIND() as per the comment by #P.b:
=COUNTIF(A$2:A2,LEFT(A2,FIND("-",A2))&"*")=1

Related

Custom format with custom Multiples Excel

I recently wanted to create an excel table to note all my electric components that I have so I can easily find the right component without searching every time for it.
The problem is, especially with capacitors, they come with a wide range of values generally for me between 220uF and 10pF, and I want to create a custom format to display the values properly in excel, for example if I put in a cell 0.00022 it shows 220uF or maybe 0.22mF (but 220uF is better) and not 2.2E-04 or any other format.
I tried the custom tool but I don't know how to add the micros, nanos and picos.
You can add conditions to the formatting, like:
[<0.00001] 0.00%%% "pF";[<0.001] 0.00% "uF";#
This will show 2.20%% uF in the cell (so you can multiply by using the percent sign, more details here).
Drawback: the percent signs are shown, and the Ctrl+J trick described on the link does not really work for me (and I personally find it as an ugly solution).
If I were you I'd add a new column called "Formatted" where I multiply the values with formulas. Like
=IF(A1<0.00001,A1*1000000 & "pF",IF(A1<0.001,A1*10000 & "uF"))
It's easier then to search in both columns (one is by formatted, like all "uF", other is by real Farad value. Also you could use the original column for sorting.

Excel percentage increase based on formula

I am trying to fill the sell price column in an Excel spreadsheet with the increased values in colors based on the round up columns value (1 to 50 green, 50 to 100 blue, 100 to 150 yellow, 150+ pink).
I've opted for the percentage table because some items can be sold for a lot more than what I have purchased them for, so that's just for my benefit. I am open to any other suggestions and I am new to this whole business thing.
I was using IF in my formula which would work great for using one percentage increase in the formula:
=IF($E27<50,ROUNDUP(I$27,-1))
If I try to enter a second argument like
=IF(OR($E28<50,ROUNDUP(I$28,-1)OR($E28>50,<100,ROUNDUP(J$28,-1))))
I will get an error.
I'm probably using the formulas wrong, I've tried "AND" and a couple other formulas, but I can't find anyone else trying to achieve the same or similar.
So something like this:
=IF($E28<50,ROUNDUP(I$28,-1),IF($E28>50,ROUNDUP(J$28,-1),"Error"))
But not sure what the <100 was for.
Although the problem is not completely clear, I understand that you want to add a formula with nested if statements.
I will recommend you to try nested ifs in parts.
=IF($E27<50,ROUNDUP(I$27,-1),"First if condition is false")
If everything is working as per the requirement then edit that text in the formula to add another if statement.
=IF($E27<50,ROUNDUP(I$27,-1),IF(OR(condition 1, condition 2,more conditions),"value if true","value if false"))
In the second argument provided by you, the arguments of the OR function has not been properly provided. Ensure that all the arguments of an OR function are conditions separated by a comma.
$E28<50 This is a condition so it's ok.
But other arguments are not making sense.
Also, using OR multiple times inside the first OR arguments is not clear.
It would be beneficial if you could provide the basic table and mention the requirement clearly.

Finding the MODE in Excel with VLOOKUP?

I have a question about finding the MODE in excel. The table below shows 4 different income brackets and then how many families are in each bracket
I wanted to ask if its possible to find the MODE of the data set bellow without having to write it down like i did on the right side of the table?
I tried using MAX to find the largest number of families in a single income bracket and then using VLOOKUP to find the corresponding value in the other column, but for some reason it does not work.
Use this formula instead
=VLOOKUP(MAX(B23:B26),CHOOSE({1,2},B23:B26,A23:A26),2,0)
Actually, one of the vlookup()'s limitation is to read the array from left to right only. In your problem, you have lookup values on the right side and values to return on the left. CHOOSE function here does the job for reversing the data/array for you.
GOOD LUCK

Define Status depending on Criteria

I have advanced Excel/Google Sheets skills. I have more of a conceptual question. I am happy with any solution (Excel or for Sheets, no difference for me).
I have a sheet where various coworkers have access and work with. It is used to define which product needs to go through which steps. Then when a part of a job is done, the status of the product is changed depending on criteria.
You can also think of it as projects and the status of a project.
The 3 examples shows how the data is input by the workers. Sometimes, the "No" cells are empty, sometimes they have a "No", sometimes for the same product, one criterion is empty, the other has a "No".
If I do a nested IF formula, I would have to create 32 of them (I believe, since its 5 criteria with each 2 options).
Obviously I can do that. I was wondering anyone has a better solution for me? Something more practical.
Thanks in advance!
Based on the data you've provided, it looks like your statuses are based on the number of Yes's in the input columns. Also you don't have a status shown for zero Yes's so I'll make an additional for that.
Given that assumption you can use a combination of the COUNTIF function (to count the Yes's), and the IFS function (to manage nested Ifs better) to drastically reduce the size of your function.
To make this cleaner I suggest you add a column and hide it containing: =COUNTIF([InputCriteria1to5Range],"Yes")
For the next formula assume the formula above is in B2. In your status column put the following:
=IFS(B2=5, Status1, B2=4, Status2, B2=3, Status3, B2=2, Status4, B2=1, Status5, B2=0, Status6)
Solution: Thanks to all for your help, I ended up firstly, creating ALL scenarios. This was actually the most complex part. See https://www.mrexcel.com/forum/excel-questions/654871-how-generate-all-possible-combinations-two-lists-without-macro.html (Answer from "Tusharm") where I had to repeat this process 5 times to have all possible outcomes. In the end, there were 192 combinations.
Then, I assigned a status for each combination.
Finally, for each product/row, I created another column where I concatenated the different criteria so that it looks exactly like my above combinations. Then finally index match the concatenated criteria to my combinations.

Sharepoint: Calculated Column replace all spaces

Seems like it would be a simple thing really (and it may be), but I'm trying to take the string data of a column and then through a calculated column, replace all the spaces with %20's so that the HTML link in the workflow produced email will actually not break off at the first space.
For example, we have this in our source column:
file:///Z:/data/This is our report.rpt
And would like to end up with this in the calculated column:
file:///Z:/data/This%20is%20our%20report.rpt
Already used the REPLACE, and made up a ghastly super nested REPLACE/SEARCH version, but the problem there is that you have to nest for EACH potential space, and if you don't know how many up front, it doesn't work, or will miss some.
Have any of you come across this scenario and how did you handle it?
Thanks in advance!
As far as I know there is no generic solution using the calculated-column syntax. The standard solution for this situation is using an ItemAdded (/ItemUpdated) event and initializing the field value from code.
I was able to solve this issue for my circumstances by using a series of calculated columns.
In the first calculated column (C1) I entered a formula to remove the first space, something like this:
=IF(ISNUMBER(FIND(" ",[Title])),REPLACE([Title],FIND(" ",[Title]),1,"%20"),[Title])
In the second Calculated column (C2) I used:
=IF(ISNUMBER(FIND(" ",[C1])),REPLACE([C1],FIND(" ",[C1]),1,"%20"),[C1]).
In my case, I wanted to encode upto four spaces, so I used 3 calculated columns (C1, C2, C3) in the same fashion and got the desired result.
This is not as efficient as using a single calculated column, but if SUBSTITUTE will not work in your SharePoint environment, and you cannot use an event handler or workflow, it may offer a workable alternative.
I actually used a slightly different formula, but it was on a work machine to which I don't have access at the moment, so I just grabbed this formula from a similar S.O. question. Any formula that will replace the first occurrence of a space with "%20" will work, the trick is to a) make sure the formula returns the original string unchanged if it does not have more spaces in it, and b) test, test, test. Create a view of your list that has the field you are trying to encode, plus the calculated fields, and see if you are getting the results you want.
so that the HTML link in the workflow produced email will actually not break off at the first space.
The browser only does this if you have not enclosed your link in quotes
If you wrap the link in quotes, it does not cut off at the first space
In a SharePoint Formula it would be:
="""file:///Z:/data/This is our report.rpt"""
becuase two quotes are the SP escape notation to output a quote
You can use this formula (Start trim for 1, in my case was 4):
=IF(ISBLANK([EUR Amount]),"",(TRIM(MID([EUR Amount],4,2))&TRIM(MID([EUR Amount],6,2))&TRIM(MID([EUR Amount],8,2))&TRIM(MID([EUR Amount],10,2))&TRIM(MID([EUR Amount],12,2))&TRIM(MID([EUR Amount],14,2)))*1)

Resources