So I am wondering if there is a way to skip certain rows for a cucumber data table. Lets say given this example (taken from cucumbers website)
Scenario Outline: feeding a suckler cow
Given the cow weighs <weight> kg
When we calculate the feeding requirements
Then the energy should be <energy> MJ
And the protein should be <protein> kg
Examples:
| weight | energy | protein |
| 450 | 26500 | 215 |
| 500 | 29500 | 245 |
| 575 | 31500 | 255 |
| 600 | 37000 | 305 |
I want to only skip the 2nd data line (weight:500..). Is this possible? If currently not, where can I find the cucumber tags and add my own custom ones? I would love for a soltion like #wipR2 #wipR4 where R2 and R4 mean row 2 and 4.
You can do this by splitting up your examples table into two and using #wip tag on one of them. Then run the test with the negate wip tag - ~#wip in 'tags' options to filter in cucumberoptions.
Examples:
| weight | energy | protein |
| 450 | 26500 | 215 |
| 575 | 31500 | 255 |
| 600 | 37000 | 305 |
#wip
Examples:
| weight | energy | protein |
| 500 | 29500 | 245 |
Related
I have a cross table as follows -
ColumnA ColumnB ColumnC
+================+===========+===========+===========+===========+===========+===========+
| Store Location | Category1 | Category2 | Category1 | Category2 | Category1 | Category2 |
+================+===========+===========+===========+===========+===========+===========+
| Boston | 200 | 100 | 250 | 230 | 230 | 210 |
+----------------+-----------+-----------+-----------+-----------+-----------+-----------+
| New York | 180 | 150 | 310 | 270 | 240 | 220 |
+----------------+-----------+-----------+-----------+-----------+-----------+-----------+
| Stockholm | 190 | 140 | 180 | 160 | 220 | 210 |
+----------------+-----------+-----------+-----------+-----------+-----------+-----------+
| London | 170 | 140 | 340 | 310 | 420 | 380 |
+----------------+-----------+-----------+-----------+-----------+-----------+-----------+
I want to calculate the difference between two categories for each Columns as follows -
ColumnA ColumnA Diff ColumnB ColumnB Diff ColumnC ColumnC Diff
+================+===========+===========+=====+===========+===========+====+===========+===========+====+
| Store Location | Category1 | Category2 | | Category1 | Category2 | | Category1 | Category2 | |
+================+===========+===========+=====+===========+===========+====+===========+===========+====+
| Boston | 200 | 100 | 100 | 250 | 230 | 20 | 230 | 210 | 20 |
+----------------+-----------+-----------+-----+-----------+-----------+----+-----------+-----------+----+
| New York | 180 | 150 | 30 | 310 | 270 | 40 | 240 | 220 | 20 |
+----------------+-----------+-----------+-----+-----------+-----------+----+-----------+-----------+----+
| Stockholm | 190 | 140 | 50 | 180 | 160 | 20 | 220 | 210 | 10 |
+----------------+-----------+-----------+-----+-----------+-----------+----+-----------+-----------+----+
| London | 170 | 140 | 30 | 340 | 310 | 30 | 420 | 380 | 40 |
+----------------+-----------+-----------+-----+-----------+-----------+----+-----------+-----------+----+
My horizontal axes expression is as follows -
[Axis.Default.Names] NEST [CategoryName]
What custom expression need to use to get it? Appreciate any suggestions.
Thanks a lot.
I haven't found a great way to do this in the cross table. There is one way but it's a little messy depending on how many different values are in the category column and you'd need to know the values in advance. Basically in the cell values axis you would write a custom expression for each column you'd like to see rendered on the horizontal axis. Something like this for each axis:
Vertical Axis:[Store Names]
Horizontal Axis: (Column Names) <--written just like that, or selected from the dropdown on the axis
Values Axis:
sum(if([category]="A", [sales])) as [Sum of A],
sum(if([category]="B", [sales])) as [Sum of B],
sum(if([category]="A", [sales])) - sum(if([category]="B", [sales]) as [delta A-B]
So long as you have "(column names)" on the one of the axes, you can write independent expressions separated by commas on the values axis to back your way into a blend of calculations that aren't applied uniformly to whatever else is on the axis. Its a bit of a slog and can cause issues when new values pop up in your data unexpectedly but it works. Unfortunately it doesn't play nice with marking though. Good luck.
I'm not very experienced with excel, I have made 2 tables, one for our costs and one for our ticket sales.
I would like to make a chart visualizing how many tickets we need to sell to break even.
We don't have any variable costs so just want one horizontal line for the fixed costs (bottom of the left table) and one for ticket sales.
The problem I've got is we have 3 tiers of tickets at different prices so this wont just be a straight line. Each tier of ticket can only be bought once the previous tier has run out. I.e after 50 tickets have been sold, the price goes up to £7.
Here are the tables:
EDIT:
This is the kind of chart I want to make:
Set up another table that has the # of sales as one line item, and the cost as a second line item, and build the chart (under the insert menu) from it.
The data should look similar (but with the full numbers) to the attached picture.
It should end up looking similar (but smoother) to this:
One way to get to where you want to go is set up the following data table:
| Qty | Tier1 | Tier2 | Tier3 | BE |
|-----|-------|-------|-------|------|
| 10 | 50 | 50 | 50 | 1015 |
| 20 | 100 | 100 | 100 | 1015 |
| 30 | 150 | 150 | 150 | 1015 |
| 40 | 200 | 200 | 200 | 1015 |
| 50 | 250 | 250 | 250 | 1015 |
| 60 | | 320 | 320 | 1015 |
| 70 | | 390 | 390 | 1015 |
| 80 | | 460 | 460 | 1015 |
| 90 | | 530 | 530 | 1015 |
| 100 | | 600 | 600 | 1015 |
| 110 | | 670 | 670 | 1015 |
| 120 | | 740 | 740 | 1015 |
| 130 | | 810 | 810 | 1015 |
| 140 | | 880 | 880 | 1015 |
| 150 | | 950 | 950 | 1015 |
| 160 | | | 1040 | 1015 |
| 170 | | | 1130 | 1015 |
| 180 | | | 1220 | 1015 |
| 190 | | | 1310 | 1015 |
| 200 | | | 1400 | 1015 |
| 210 | | | 1490 | 1015 |
| 220 | | | 1580 | 1015 |
| 230 | | | 1670 | 1015 |
| 240 | | | 1760 | 1015 |
| 250 | | | 1850 | 1015 |
which list out the quantities and corresponding revenue under each tier plus the break even target which would be the fixed cost in your example.
Highlight the data table and insert a Line Chart from it. The line chart will look funny in the first place.
Click anywhere within the line chart, you will see a Design tab showing on your ribbon, go to that tab and click on the Select Data button:
Then manually modify the Series (left section) and Axis Labels (right section) as shown below:
Where Tier1 should be all the data from the Tier1 column, Tier2 should be all the data from the Tier2 column, Tier3 should be all the data from the Tier3 column, BE should be all the data from the BE column, and Axis Labels should be all the data from the Qty column.
If you have set up the data correctly (and ordered the series in the exact way as mine) , then you should have something similar to the following:
Please note I have modified the formats and styling of the chart to make it look more "attractive". The water is quite deep in the world of charting in Excel and I will leave it to you to explore.
A tip here, you can click on any elements of the chart, and press Ctrl+1 key on your key board to bring out the format panel on the right of your worksheet. You can test out each function and eventually craft the chart in a way you desired. Or you can use a standard style given in the Design tab.
Let me know if you have any questions. Cheers :)
Requirement: Split a list in to 4 separate groups, based on a value for each row.
| Player | Skill |
| ------------- |:-------------:|
| Player 1 | 10000 |
| Player 2 | 50000 |
| Player 3 | 2000 |
| Player 4 | 11000 |
| Player 5 | 7525 |
| Player 6 | 100 |
| Player 7 | 999 |
| Player 8 | 14579 |
| Player 9 | 26700 |
So in the example above, these players would be split in to 4 groups:
| Group | # of players |
| ------------- |:-------------:|
| Group1 | 2 |
| Group2 | 2 |
| Group3 | 2 |
| Group4 | 3 |
The number of players in a group needs to be as close as possible, however, as a group, the groups total Skill needs to around similar in numbers each time.
Before I go too far down the rabbit hole (as wording a question like this in a simple google search is not turning out very well) are there any built in functions of Excel that can be leveraged to achieve this or possible efforts in VBA that can be explored to achieve the required result?
This isn't an answer! But suppose you try a simple algorithm:
Calculate average skill level (ASL) for all 9 players
Set TSG (total skill for group) to zero.
Loop:Take largest skill Level (LSL) of remaining players
If TSG+LSL>ASL
Go to next group
Else
Add to total skill (TSG) for this group
Remove player from list
Repeat loop until no players remaining.
If you apply this by hand to your data you should get:
Average=30725.75
+---------+---------+---------+---------+
| Group 1 | Group 2 | Group 3 | Group 4 |
+---------+---------+---------+---------+
| 50000 | 26700 | 14579 | 10000 |
| | 2000 | 11000 | 7525 |
| | 999 | | |
| | 100 | | |
| | | | |
| 50000 | 29799 | 25579 | 17525 |
+---------+---------+---------+---------+
Clearly there are a couple of issues - you might not want a single group containing only player with highest skill level. Also you might want to re-average the remaining players after taking out the most skilful player. Should be a starting point though - could be implemented fairly easily with formulas or VBA.
I have a table with name, volumes processed and accuracy percentage. I want to calculate who has more impact overall on my business based on those two data points. I tried SUMPRODUCT by giving 50 - 50 weight-age for both data points equally but I didn't get good result. Any other method I can use to know the impact/ranking?
+------+--------+----------+
| Name | Volume | Accuracy |
+------+--------+----------+
| ABC | 251 | 52.99% |
| DEF | 240 | 70.00% |
| FGH | 230 | 74.35% |
| IJK | 137 | 84.67% |
| LMN | 136 | 56.62% |
| OPQ | 135 | 75.56% |
| RST | 128 | 60.16% |
| UVW | 121 | 70.25% |
| XYZ | 120 | 68.33% |
| AJK | 115 | 35.00% |
| LOP | 113 | 100.00% |
+------+--------+----------+
I'm afraid nobody here will be able to tell you what the business rules are for your business.
One approach might be to multiply volume by accuracy, then rank it, either with a formula or with conditional formatting color scales.
Depending on your business logic, you may want to put more weight on either volume or accuracy, so you may want to raise one value to the power of 2 before multiplying it with the other.
The technique is "use a formula to calculate the weighting". What that formula is will depend on your business logic. The following screenshot shows a weighting formula with simple multiplication, conditionally formatted with color scales and a rank formula in the next column.
Background
I'm creating a grade book in Excel for my wife. I have sheets for the overall grade, classwork, exams, and participation.
The three sections of work (classwork, exams, and participation) each have a variable number of items, and each item has a different number of points possible. Each section has a weight in the overall grade.
I have this up and running with a fixed number of items per section, but I'd like to create a template that can be updated from class to class and year to year.
Here's the problem:
On the classwork sheet, I'd like to be able to enter new assignments and their point value and have that automatically update the master grade sheet on my first sheet tab. Is there any way to add columns in a section of one worksheet (the master grade sheet) when new rows are added to another worksheet (the list of assignments)?
It is possible to achieve this without using VBA. The reason you will have difficulty acheiving this, however, is that you've violated normal form in the table you've already built. It appears the pertinent data you're looking for is each student's score on each assignment. If this if correct, the level of granularity you will want is on the Assignment, not on the Student.
There are some fairly quick ways to modify your existing work to account for this. I've written out some sample data below. Take a look and see if it helps.
Sample Original Table
+---------+------+------------+------------+
| Student | Quiz | Thumbnails | Watercolor |
+---------+------+------------+------------+
| Paul | 3 | 10 | 90 |
| Frank | 4 | 10 | 95 |
| Mary | 5 | 10 | 70 |
| Ellen | | 10 | 85 |
| Sue | 6 | 10 | 92 |
| Anton | 5 | 10 | 87 |
+---------+------+------------+------------+
Image of the data is below ( note I have highlighted the blank value ).
Sample Normal Table
+---------+-------------+-----------+-------+
| Student | Assignment | New_Score | Score |
+---------+-------------+-----------+-------+
| Paul | Quiz | | 3 |
| Frank | Quiz | | 4 |
| Mary | Quiz | | 5 |
| Ellen | Quiz | | 0 |
| Sue | Quiz | | 6 |
| Anton | Quiz | | 5 |
| Paul | Thumbnails | | 10 |
| Frank | Thumbnails | | 10 |
| Mary | Thumbnails | | 10 |
| Ellen | Thumbnails | | 10 |
| Sue | Thumbnails | | 10 |
| Anton | Thumbnails | | 10 |
| Paul | Watercolor | | 90 |
| Frank | Watercolor | | 95 |
| Mary | Watercolor | | 70 |
| Ellen | Watercolor | | 85 |
| Sue | Watercolor | | 92 |
| Anton | Watercolor | | 87 |
| Mary | ExtraCredit | 10 | 10 |
| Ellen | ExtraCredit | 8 | 8 |
| Sue | ExtraCredit | 9 | 9 |
| Anton | ExtraCredit | 10 | 10 |
+---------+-------------+-----------+-------+
Image of the data is below. The score column reaches back to your old table and grabs the score you've already entered for the students, so you won't have to do this all manually. The formula for this is =INDEX(non_normal,MATCH([#Student],non_normal[Student],0),MATCH([#Assignment],non_normal[#Headers],0)).
This assumes you've formatted the old data into an Excel DataTable ( ctrl+t ) and named it non_normal ( alt+j+t+i ). Note the unsubmitted assignment for Ellen comes through with a score of zero using this method. I've added a column named New_Score so that you are able to add new student-assignment submission combinations to the table without having to modify your old non_normal table ( which was the trouble in the OP ). With this column added, the formula in the Score column can be changed to =IF(NOT(ISBLANK([#[New_Score]])),[#[New_Score]],INDEX(non_normal,MATCH([#Student],non_normal[Student],0),MATCH([#Assignment],non_normal[#Headers],0))) which will take the New_Score value if available and the original score if not.
The orange cells are new student-assignment submission combinations. Note you do not need to add a row for every student, just add a row whenever a student submits an assignment.
Sample Assignments Table
+-------------+-----------------+
| Assignment | Points_Possible |
+-------------+-----------------+
| Quiz | 6 |
| Thumbnails | 10 |
| Wartercolor | 100 |
| ExtraCredit | |
+-------------+-----------------+
I've added the ExtraCredit assignment with a possible max score of zero/blank ( since not completing extra credit shouldn't count against a student )
Payoff - Back to the Original Table
+--------------+---------------+------------+------------+-------------+-------------+--------+
| Sum of Score | Column Labels | | | | | |
+--------------+---------------+------------+------------+-------------+-------------+--------+
| Row Labels | Quiz | Thumbnails | Watercolor | ExtraCredit | Grand Total | |
+--------------+---------------+------------+------------+-------------+-------------+--------+
| Anton | 5 | 10 | 87 | 10 | 112 | 96.6% |
| Ellen | 0 | 10 | 85 | 8 | 103 | 88.8% |
| Frank | 4 | 10 | 95 | | 109 | 94.0% |
| Mary | 5 | 10 | 70 | 10 | 95 | 81.9% |
| Paul | 3 | 10 | 90 | | 103 | 88.8% |
| Sue | 6 | 10 | 92 | 9 | 117 | 100.9% |
+--------------+---------------+------------+------------+-------------+-------------+--------+
Using the image below, you pivot your newly normalized data into a Pivot Table. ( alt+n+v ). Now, simply adding a new assignment to the normal_assignment DataTable will cause that assignment to appear in a new column when you refresh the Pivot Table ( alt+a+r+a ).
The % score on the right of the Pivot Table is calculated using the following formula ( with the sample Pivot Table starting in cell $M$2 ): =GETPIVOTDATA("Score",$M$2,"Student",M4)/SUM(assignment[Points_Possible])
I've uploaded the raw sample file for this to my public repo if you'd like to pull it and take a peek at the source. Credit to sensefulsolutions for text-to-table conversion.
Hope this is what you need!