A function in excel that outputs a Y or an N if all the values are equal for a specific value - excel

Components
Serial Num
Market 1
Market 2
Market 3
1234
100000000
N
Y
N
1233
100000001
N
Y
Y
1235
100000000
Y
N
N
1236
100000000
N
Y
N
1231
100000001
Y
Y
Y
I have a table with over 1k rows each with repeating and different serial numbers. The table's market status (Y or N) is based on an Xlookup that checks the component number and the components market status in another tab. The components market status is accurate. However, since the serial numbers repeat, I'm trying to create a function that can check that if for example, check if Serial number "100000001" is fully qualified Market 2. When it checks Market 2 would be "Y" because all of the "100000001" have a Y in Market 2 but if we do the same for "100000000" it should be "N" because not all of its Market qualify or have "Y". It would be simple there were a small amount of serial numbers but there's over 1k so I was trying to find out if anyone knows if this could even be possible with a spreadsheet of this size. In essence I think it would be like an Xlookup function but it would need to find and check the market status for each Serial number found and then equate if the value is equal to "Y" for each, if they all are then "Y" would come out, otherwise "N".
I hope this makes sense. It's the first time I post on stackoverflow, as such, definitely feel free to let me know if there's anything I can do to make this question clearer or up to standard with StackOverFlow language.
--
I tried using the =FILTER function but when it outputs data it creates a spill since for each serial I would need space below to give me the values. From there I would create an =AND(EXACT([range of the values output],"Y")). This would determine if all the values in the range are equal to Y, if they are "TRUE" would be the output, if not then "FALSE".
I also tried creating an xlookup function that would look for the smallest value. In doing so I would make the Market outputs Y1 and N. What I hoped would happen is that if it came across an "N", it would give me that output first. Since all it takes for the market status of the serial to be "N" is one N in its market. Only way it can be a Y is if they're all the same. Nonetheless, this does not work since XLookup only looks for the value of the serial code and not the market status value.
Hey guys thank you all for your support! I figured out a solution to the madness haha. I downloaded Ablebits which has the ability to merge together cells that contain duplicate values and the columns that contain those values are included together separated by semicolons. For instance, if merged all the cells in my example, serial number "100000000" would have the following under each market: Market 1 (N;Y;N), Market 2 (Y;N;Y), Market 3 (N;N;N). From there I created 2 color conditions in this order. 1.) if any cell contains an "N" then it would be red indicating that it isn't qualified. 2.) If any cell contains a "Y" then it would be green [since the first rule made those that contain an N red, then this one would only apply to those that have all Y;Y;Y;Y or just 1 "Y" if it didn't repeat. It does not exactly give me an output of Y or N but with all the values in a cell we can distinguish which ones have all qualifications and which don't.

Related

Finding the optimal selections of x number per column and y numbers per row of an NxM array

Given an NxM array of positive integers, how would one go about selecting integers so that the maximum sum of values is achieved where there is a maximum of x selections in each row and y selections in each column. This is an abstraction of a problem I am trying to face in making NCAA swimming lineups. Each swimmer has a time in every event that can be converted to an integer using the USA Swimming Power Points Calculator the higher the better. Once you convert those times, I want to assign no more than 3 swimmers per event, and no more than 3 races per swimmer such that the total sum of power scores is maximized. I think this is similar to the Weapon-targeting assignment problem but that problem allows a weapon type to attack the same target more than once (in my case allowing a single swimmer to race the same event twice) and that does not work for my use case. Does anybody know what this variation on the wta problem is called, and if so do you know of any solutions or resources I could look to?
Here is a mathematical model:
Data
Let a[i,j] be the data matrix
and
x: max number of selected cells in each row
y: max number of selected cells in each column
(Note: this is a bit unusual: we normally reserve the names x and y for variables. These conventions can help with readability).
Variables
δ[i,j] ∈ {0,1} are binary variables indicating if cell (i,j) is selected.
Optimization Model
max sum((i,j), a[i,j]*δ[i,j])
sum(j,δ[i,j]) ≤ x ∀i
sum(i,δ[i,j]) ≤ y ∀j
δ[i,j] ∈ {0,1}
This can be fed into any MIP solver.

Identify overlapping configurations in Excel

I'm setting up a configuration excel sheet to be imported into a database.
It has four columns
Equipment Fleet Start Date End Date Highlight Me
=============================================
A X 1-Jan-20 5-Jan-20 X
A Y 6-Jan-20
B C 1-Jan-20 3-Jan-20
B D 4-Jan-20 10-Jan-20
A Z 3-Jan-20 X
A Z 5-Jan-20 X
I need to identify and highlight overlapping configs
I'd like lines 1, 5 and 6 to be highlighted.
They are all a configuration for the same Equipment, but their configuration dates overlap
Fleet is that attribute we are configuring for the date range but has no bearing on the validation
Constraints:
I'd like to use tables (not named ranges) for this. My table is called tblFleetConfig
Yes I could do this in VBA but I don't want to deal with trusted workbooks etc. etc.
So far I have pasted this into a column on the right
=
(tblFleetConfig[#[Start Date]] >= tblFleetConfig[Start Date])
*
(tblFleetConfig[#[Start Date]] <= tblFleetConfig[End Date])
*
(tblFleetConfig[#Equipment]=tblFleetConfig[Equipment])
The result I'm getting is a 1 for the first line and 0 for every other line.
Clearly I don't understand this syntax and I'm interested in learning.
You asked a complicated one, those blanks throw a wrench into it.
Your formula is the right syntax, you need to wrap it in a SUMPRODUCT() though.
=SUMPRODUCT((tblFleetConfig[End Date]<=tblFleetConfig[#[End Date]])*(tblFleetConfig[Start Date]>=tblFleetConfig[#[Start Date]])*(tblFleetConfig[Equipment]=tblFleetConfig[#Equipment]))
This is your formula wrapped it in a SUMPRODUCT().
This will return a 1 if there is a single occurrence and a number greater than 1 if multiple.
Let me know if it works.

How to find numeric values Before & After a String in an Excel Cell

I hope I can get some assistance as to which formula to use. In the three rows below, I am trying to pull values from the right.
First line you can see that we have 10x50 meaning 10 packages have 50 items each. So I need to extract values Before and After X
It could be two cells, where I have values Before X and then next cell values After X. Sometimes the X is located a few spaces before the last word. I'm wondering if any kind soul can help please?
DEXTROSE 50% 2G/ML 10X50 LSSYR
LEVETIRACETAM INJ USP 500MG SSOL 25X5
DOBUTAMINE 100 INJ 1X5 ML AMP SAM (PF)
This should work for you. Assumes the measurement is at the end, or near the end and looks for the last occurrence of "x". So if there is another x after this measurement, then it will not work. Also your example had only numbers between 1 and 99 (aka no more than two digits). So this formula will not work if the measurement is longer than 5 characters. aaXbb is OK. aaaXbb is not OK.
=TRIM(RIGHT(LEFT(A1,SEARCH("^^",SUBSTITUTE(A1,"x","^^",LEN(A1)-LEN(SUBSTITUTE(A1,"x",""))))+2),5))

Color code cells based on demographics and test scores (multiple conditions)

I have established a datasheet with all 4th grade students. This data includes name, race, economically challenged, and their latest state assessment scores.
Column D is race - N if White / Y if other than White
Column E is economic situation of child - if in trouble Y / otherwise N
Column G is their test score.
Here is what I cannot get to work...
If any student scores less than a 70, we need the text to be RED (which I can do easily).
However, I need to figure out a way to recognize this...
If D is = Y, AND the grade is less than 70... I need to fill the cell with red and have white text. Any student that is D = N and still less than 70... text should remain red.
That is one problem. I need a separate rule to recognize when D = Y and E = Y AND score is less than 70... I need to fill that cell with black.
Our goal is to recognize quickly the deficiencies in our non-White and very low income students.
Is there anyone who may be able to help?
You can do this with conditional formatting.
Under conditional formating go to Manage Rules. You are going to add three rules. In the end it will look like this:
The formulas are:
=AND($D2 = "Y",$E2 = "Y",$G2 <70)
=AND($D2 = "Y",$G2 <70)
=$G2 <70
Add the three rules with the corresponding formats. Then make sure they are in the order that is shown in the picture. Also make sure that the "Applies to" cover the entire needed range.

Excel rounded number unrounds itself no matter what function is used

I'm having rather strange problem. I have multiple rows and I need to get some information. I need percentage of discount that needs to be applied to D value and I get it in E column. Then I need text of that result embedded with some other data as in example. It works just fine until I hit the G column where the number magically unrounds itself to its full value. It doesn't matter what I do in E or F, G is still pulling those forgotten decimal places (up to 10). I used mod, round, fixed... I don't know anymore, it would be easier to write functions I didn't use. It's driving me crazy. Please, any idea ?
P.S. The table has more than one row, but this row is enough to show you the trouble I'm having.
A B C D E F G
1 12345 5 100 300 =1-(C1/D1) =A1&B1&ROUND(E1*100;3) =F1&F2&F3&F4&F5

Resources