i'm trying to get the following result with a formula. In the picture below you can find 5 possible outcomes from the data.
Colomn A: check of a test is done
Colomn B: Testname or testnumber
Colomn C: Result of the test taken
Every test will get a unique number, but will be duplicated every time a test has been done. Whatever the outcome.
So every test number can only have one "YES" in column A, all the other attempts should be "NO" and if the test results eventually becomes "SUCCESS" it should turn "YES" in column A for this line and all the other attempts should turn to "NO" for that particular test number.
The result "SUCCESS" overrules everything and "ERROR" overrules "NOT TESTED".
I've managed to put YES for every unique results, but I'm stuck at turning this YES to NO if the results is eventually SUCCESS.
If I understand your requirement correctly, it sounds as though you may be able to achieve what you need using the COUNTIFS formula, providing you can get a unique list of test names. There is a formula method to get a unique list, but using it on such a large dataset will likely drain your Excel's resource, so it may be easier to just use an advanced filter.
You can use the formula to count per test name the volume of successes, errors and non tests.
I've taken your data from your post as though that were the source data, to give the following output:
Enter the following formula in F2, and you can then drag down and right to fill F-H. You'll obviously need to extend your ranges to suit your actual data source.
=COUNTIFS($A$2:$A$17,$E2,$B$2:$B$17,F$1)
In I2, use a simple IF formula to evaluate the counts and return the overall status based on your "Success > Error > Not Tested" heirarchy.
=IF(F2>0,"Success",IF(G2>0,"Error","Not Tested"))
This should keep it fairly simple to read and alter when required, but if you didn't want the individual status count columns, then you may change the IF formula to include the COUNTIF formulas within, and manually reference the status descriptors, like so:
=if(COUNTIFS($A$2:$A$17,$E2,$B$2:$B$17,"Success")>0,"Success",if(COUNTIFS($A$2:$A$17,$E2,$B$2:$B$17,"Error")>0,"Error","Not Tested"))
Related
Title says it all pretty much, So in the image the sum looks for the first entry as it has "mr human" in the cell next to it but when i try to designate my critera range for a single cell i get #value returned, I can solve this by entering "mr human" into all the adjacent cells however to sheet I am pulling the data from has is formatted like It is shown so it would be ideal If i didnt have to make a copy then do that as this can be for several hundred "mr & Ms/miss"
Thanks for any help in advance!
First of all, I would say that you should indeed consider using a different model data for this, as suggested by #ScottCraner.
Second, this solution may work, but if you have a lot of sets (when i mean sets, i mean Mr Human, Miss Human, Kid Human, Grandp Human, and many more) it can be kind of annoying.
Now, first thing you must do is creating named ranges of each set of data. So the values related to Mr Human will be namedMR_HUMAN and values of Miss Human will be named MISS_HUMAN. It's easy to do.
Remember:
Names can't have blanks, spaces, or any weird char. Just use underscore.
Each name must be unique
Each name must contain 2 columns: first one is Code and Second one Cost.
A video example (type the name and press ENTER
Now the formula for column C:
=IFERROR(VLOOKUP(B3;CHOOSE(MATCH($A$3;{"Mr Human";"Miss Human"};0);MR_HUMAN;MISS_HUMAN);2;FALSE);"Not found")
You can see below that if I change cell A3 to Miss Human, values change properly:
This is how the formula works:
MATCH($A$3;{"Mr Human";"Miss Human"};0) This will search the text in A3 into the array of sets and will return a number according to position. In this case, Mr Human=1 and Miss Human=2
CHOOSE(*number from step 1*;MR_HUMAN;MISS_HUMAN) We use the number obtained in step 1 to combine with function CHOOSE, which allows to select a result based on a list. So we can use this function to relate number 1 to name MR_HUMAN and number 2 to MISS_HUMAN and it will return our target range with right values.
VLOOKUP(B3;*name from step 2*;2;FALSE) We combine the range from previous step and use it as matrix of a normal VLOOKUP, that will search the CODE in first column, and will return the value from second one (COST)
We trap all above inside an IFERROR, just to avoid VLOOKUP returning an error (error in VLOOKUP means that CODE is not found in that range).
The big issue here is that if you got a lot of datasets for more values, besides Mr Human and Miss Human, you need to adjust the MATCH and CHOOSE part, and can be annoying.
Anyways, hope this helps a little bit.
VLOOKUP
function
IFERROR
function
MATCH
function
CHOOSE
function
Also, consider using a different data model and the resume data using Pivot Tables.
I'm trying to find a way to perform an INDEX MATCH lookup that goes beyond the first match to check if all matching values are equivalent. I've found formulas that will return all matches, but what I'd like to do is have the matching value returned in the formula cell, but only if all values returned are the same.
Here's an example:
I'm matching the report number with the report number below and only picking up the area value if all report-area combinations are the same. Is there a clean way to do this?
Dan.
My solution may seem a bit messy, but you can make it simpler as you go, once you start implementing it:
First, I made a Report Count. (How many 12345 Reports are there in total, and so on).
=COUNTIF($A$2:$A$10;A2)
Then, I concat the Report-Area to get a unique identifier for every Report-Area combination.
=A2&"-"&B2
Now, I make a Count of that column, meaning I count how many combinations are there for each case (e.g. how many 12345-2C are there in total).
=COUNTIF($D$2:$D$10;D2)
Then, I create an "Ok" Column for checking if the Report Count matches the Concat Count.
=IF(C2=E2;"OK";"")
That said, we have our table ready for checking what you're looking for.
In just one formula (the one under Lookup header) on cell B13:
=IF(INDEX(F2:F10;MATCH(A13;A2:A10;0))="OK";INDEX(B2:B10;MATCH(A13;A2:A10;0));"")
I check IF there's an "OK" on the OK column for that Report number.
If there is, I Search for the "Area" value for that Report number.
If there isn't an "OK", I leave a blank cell. (In your example, it's #N/A)
The formulas on H2, I2 and C13 are just for reference. Plain text.
Again, I know it seems messy, but if you're not too familiar with some Excel formulas and functions, this is a good way to learn and build complex formulas step by step (Just as our fellow n8 said)
I assume you understand how INDEX MATCH works. If you don't, I'll edit an explanation for you.
Good Luck!
I have a sheet which has cells with the text "Test Result" and the cell next to "Test Result" contains either Pass or Fail. I want to count the number of Pass and Fail instances which are mentioned next to the cell containing "Test Result".
NOTE: The column which contains the Pass or Fail that I want to count, has other Pass/Fail instances as well. So, I want to get the Pass or Fail value which is ONLY next to the a cell containing text "Test Result".
You can use the COUNTIFS function to accomplish this. If your data was in columns A and B, this is how you would enter the formula:
=COUNTIFS(A:A,"Test Result",B:B,"Pass")
If your data is predictably structured, and you are only trying to return a single result- I would go with #Scott Craner's answer of using VLookup or Index/Match.
If your data is predictably structured, and you want to count across many results, you should probably be considering using 2 sumifs functions (one for pass and one for fail).
If your data is not predictably structured, you can consider using an array of these sumifs functions to each check a particular column against its offset column, or you can accomplish this using VBA, but it's hard for me to suggest the exact code without seeing how the data is structured/unstructured. (Your explanation of the sheet and data layout is a bit vague)
I have a duplicate value in column A with different value in column B and column C.
For example:
There are 3 column which is A, B and C.
- A has duplicate value which is serial number
- B is whether it fail the test or not
- C is the time for testing.
Is it possible with Excel to find time difference between time for first fail and pass?
I want to delete the data that have less than 12 hour so that I know the things don't need rework, just retest. I want to know the exact number of modules that need rework.
=IF(AND(B7 = "pass",B6 = "fail", A7 = A6),TEXT(C7-C6, "h:mm"), "")
To get the difference between last fail and pass use this formula in cell D7. If the cell in column B is pass and previous cell was a fail, it will work out the time difference between the previous cell that was a fail. It will also check that the cell in column A matches previous cell in column A. Can also try using Index / Match or Vlookup to get the first fail by formula. As Tim Williams said a pivot table will also help. I don't use them much, so I'm not sure how to get the time difference with a pivot table, but it'll make viewing the data easier.
You could also try adapting this formula, by nesting conditions to get the previous cell that is the first fail. Work out the maximum number of cells between a pass and a first fail, and nest it that many times. If there are cases where the fail time is later than the pass it will throw an error. If you have multiple consecutive pass cells, for the same element you'd need to add more conditions to account for that, but if there's only 1 pass per element this should work.
=IF(AND(B7="pass",B5="fail",A7=A5),TEXT(C7-C5,"h:mm"),IF(AND(B7="pass",B6="fail",A7=A6),TEXT(C7-C6,"h:mm"),""))
Scenerio - I have an Excel formula that counts the number of "YES" entries in a column then divides that count by another count of "YES" entries in a different column
=COUNTIF('All Project Tasks'!AC203:AC236,"YES")/COUNTIF('All Project Tasks'!AB203:AB236,"YES")
This works.
However, I now need to add a criteria that checks to see if the date in a date column is <= to today and if so, it should result with "Not Started" instead of the division result.
So far I have this:
=IF(D12<=TODAY(),COUNTIF('All Project Tasks'!AC2:AC18,"YES")/COUNTIF('All Project Tasks'!AB2:AB18,"YES"),"Not Started")
The "Not Started" part works in this formula but the division part is failing. I receive 0 instead of the decimal number that I get by using the first formula above.
I'm thinking I'm just missing one piece but cannot find what it is.
You could try storing the results from the formulas in different cells, then diving the cells by eachother