excel formula to entries that match a certain cell - countif

example gift card
Store Card Amount
Kroger 4242 100
On a different sheet entries
Store Card Amount
kroger 4242 50
kroger 4242 30
kroger 4242 20
Is there a formula that can subtract from the original amount of 100, as I continue to add entries?
So the gift card now has 20 dollars, until I use that 20 and add a new entry, then it would become 0.

Rather than mixing the amounts spent and the amount remaining on the different sheet, it might be ore convenient to show the remaining balance on the gift card sheet, say with:
=C2-SUMIF(Sheet2!B:B,4242,Sheet2!C:C)
Assuming the card number is unique this would facilitate keeping track of a variety of cards at a variety of stores without the need for sorting.

Related

How to generate unique trip id focusing some specific parameters?

I need to operate around 15-20 trips per day using different sized trucks round the year. I need to generate Unique Trip ID in googlesheet based on date, month, year, truck size, transporter and the number of the trip on the day. The trip IDs will be unique in the column and input in Column U. The available trucks size are L-23, L-20, M-18, M-16,S-14,S12,T-10, T-8. Truck size is input in Column S. Transporters are MLS, TLT and AHK which is input in Column T. Suppose, a trip with truck size, S-12, will move on 25th June 2022,Saturday and the Transporter is MLS. So the unique trip id will be MLS1225062201 where MLS is the transporter,12 is the truck size, 25 is the date, 06 is the month, 22 is the year and 01 is the number of the trip on the mentioned day.
For more, here is the link of googlesheet https://docs.google.com/spreadsheets/d/1LeeWIHomcnk_sPahLNJ8pXeDEz1tjSGEoQGa3ulxiKU/edit?usp=sharing
Is it possible to generate using google apps script or any other formula?
Use the formula:
=arrayformula(if(B2:B="","",(U2:U&query(split(T2:T,"-"),"SELECT Col2",0)&text(B2:B,"ddmmyy")&TO_TEXT(A2:A))))
Try adding a trip no. to for your team to fill up to help with the formula I provided
Since its an arrayformula, it will autogenerate based on the details you have normally filled in. I have done a version in the sheet you have shared.
https://docs.google.com/spreadsheets/d/1LeeWIHomcnk_sPahLNJ8pXeDEz1tjSGEoQGa3ulxiKU/edit#gid=1170569363

How to effectively store data of varying time framces

I have a form that captures production data for a certain process. When a employee enters production numbers, currently I am not sure what the time frame for the production numbers are.
E.g. Employee A enters a production number of 50 on 2017/10/02. This 50 represents the production of 1 day (2017/10/01). Now, employee B enters 550 on 2017/10/03, but this represents production for the week of 2017/09/24 to 2017/10/01.
Now, we know that various employees will be providing data of different time frames, but I'm trying to figure out the best way to manage this. I capture data using a Excel sheet with VBA, and then transfer it to a SQL database. Currently, in the database we use GROUP BY to get all data related to a certain month. So if the timestamp of the data is in September, all September data will be summed and the total used as the September total to date. However, this does not answer two key points:
If data for September is entered in October.
If data is entered that duplicates a period for the employee that was entered earlier.
What is the best way of managing this? I can change my capturing form and the way we manage data in the database.
EDIT and more information:
The information I want to capture consists of production numbers from various production areas entered by an employee. So for example, site A will have 3 sub-sites. These sub-sites will each have a production achieved, target for the period and forecasted production number.
Timestamp: Site: Sub-site: Production: Target: Forecast:
2017/10/01 PlaceA Line1 200 250 230

Getting top 5 highest numbers from across multiple columns

I have a table as follows and I am trying to make a query and obtain the top 5 numbers across all the pay columns and the associated name to that number.
I am using Java and I could derive the data by selecting them all and get the information.
Intention is to loop through them, store first 5 numbers in an array and keep updating the array if the next number is higher than that ones present in the array. Which means looping through the array each time to check against the new number.
Is there a more efficient way and I could do everything in MySQL query itself?
Table Image
Expected results would be:
1200 Simon
1150 jenny
1000 alan
900 james
800 alan

creating a subtotal based on multiple columns in ssrs report

I am working in SSRS 2008 R2 and need to create a subtotal in a report based on two columns. For example, I need to subtotal a spend amount based on Cost Center and Account Number. This seems like a simple enough requirement but I am at a standstill.
Sample data:
Business Segment Company Code Cost Center Account Ship Date Ship to Ship From Total Amount
Home Furnishing 1008 1234567890 11111 1/1/2013 Tailspin Contoso 123.45
Baby/Parenting 1536 2234567890 22222 12/31/2012 Bobs Bait Jims Tackle 543.21
Kitchen Appliances 2553 3234567890 33333 11/11/1999 Ajax Acme 1000.99
I need to provide a subtotal based on Company Code, Cost Center and Account.
Since you're grouping on multiple rows, just create groups for each of these rows, but only display totals in a header or footer for the lowest level group.
For example, I've created a simplified Dataset based on yours:
I've created a Tablix and added groups for Cost Center and Account Number. However, I only included a group footer row for the Account Number group. In this footer I've added the summed Total Amount for the Cost Center / Account Number combination. It looks something like this in the designer:
The end result looks like this; it's displaying each individual row in the Dataset plus totals for each Cost Center / Account Number combination:

Reporting Services 2008 Pie Chart from multiple fields

I want a pie chart where each of these values represent a slice of the value Total_nr_of_shipments:
Late_delivery_forwarder_fault,
Late_delivery_shipper_fault,
Late_delivery_consignee_fault,
Late_delivery_other
and the slice that represents the remaining part of the total number of shipments that makes up the shipments delivered on time.
How would you solve this?
Is it possible or is there a better way to show the performance figures?
As long as the total of all slices equal to the total of shipments, then this chart will definitely work.
Late_delivery_forwarder_fault 20
Late_delivery_shipper_fault 20
Late_delivery_consignee_fault 20
Late_delivery_other 20
Delivered_on_time 20
-----------------------------------
Total Shipments 100
If the totals do not equal the total number of shipments, then it means you have some kind of subset data. In that case, a chart would not represent the data properly. If this is the case, you would be better off with a Bar Chart.