Indexing and Calling Cell information in Excel - excel

Alright so I use excel a lot because of its cross platform functionality and I'm fed up of some of the very long workflows I have to complete for a load of weekly reports I have to do.
I've been experimenting with this for about 2 weeks and I'm not happy with any of it.
I need to input several different reports into a spreadsheet. Except all of the reports the data is in a different order and there is no way to make them all the same format. So what I was hoping to do was to give each product line (theres 170-300 product lines on each report) a numerical value and then have the spreadsheet call the cells from the different pages using its numerical index. Similar to the most basic of tables in C/C++ (the only coding knowledge I have). I have experimented with Vlookup and Address but both cant be used together and address only returns the address of the cell (but there is no way to then get this to read the data out of the cell and then other pieces of information relating to that cell.
If anyone has any ways of helping me out with this then I would be massively appreciative. P.s. To keep this simple all the reports are manually inputted so they all have the same formatting just on different sheets.

You can use INDEX MATCH to match rows and columns,
First Sec Thi
A Apple Orange Banana
B Grape Peach Harambe
C Lime Steve Goat
=INDEX(A:D, MATCH("B",A:A, 0), MATCH("Thi",1:1, 0))
Will return 'Harambe'.

Related

Using Sumproduct to calculate two tables using horizontal (table headers) and vertical references

Hopefully the title makes some sense because I'm trying to wrap my head around the logic and I'm not quite sure how to phrase the question.I'll try to give a brief explanation of the end goal without over complicating it with unnecessary details.
I have a table of survey score averages for every month per person and a correlating table with the number of surveys each person received for each month. The logic is essentially multiple the score for each month by the number of surveys, combine them, divide by the total number of surveys within that time period to get their true average. Where things get a little complicated is that I have to include the ability to set a custom date range and return the value. So sometimes I might be looking at the average for Jan - Apr, other times I might just be looking at Feb-Mar etc.
I think sumproduct is going to get what I need done but I'm running into issues trying to write it out. I've written it several different ways and none of them worked so here's one that best conveys what I'm trying to do,
=SUMPRODUCT(--(F7:I7,L7:O7>=C2),--(F7:I7,L7:O7<=C3),--(E8:E12,K8:K12=B9),tbl_average[[Jan-20]:[Apr-20]],tbl_surveys[[Jan-20]:[Apr-20]])
I super appreciate any assistance I can get on this. I'm hoping the end result is not nearly as difficult as I'm making it out to be.
Some additional information:
I'm going to be using this same process to calculate multiple metrics across multiple worksheets.In the test example each of the tables will most likely be on different sheets. The dashboard with the calculated results will contain everyone's names and will be filtered and rearranged frequently, so I need to make sure we're always matching directly to their names and not just the relative rows. Basically, in my example I show that Agent 1 is always lined up on row 8 but that's not always going to be the case. Agent 1 could be in Row 8 on Sheet 1, Row 10 on Sheet 2, and Row 12 on Sheet 3 and I need all the correct values to multiply and sum against one another.

Calculating Multiple Averages

It's my first time posting a question to this forum. Though I have found answers here many times before, I have been unable to find a solution to my current predicament.
I work in a call center and each week I need to analyze data from the thousands of call that took place over the week. I'm new to programming in Excel-VBA but I've been able to get pretty far.
The data is produced by a third party program and the format is nigh unreadable. Much of the programming I've done so far has been geared towards making the data more organized. Now, I'd like to get into more analysis.
The data is arranged by employee number (NOT in order, though). Each employee takes several calls over the course of the week, some for which the customer takes a survey. It's the survey scores I want. I want to take the average of all the surveys for each employee and then display that average in the same row as each of the entries.
Example
The yellow highlighted area is what I want to add. Any ideas? Thanks for any help in advance!
No need for VBA. If you have the supported version of Excel you can use AVERAGEIF. If not you can use below formula.
Enter as an array formula by pressing Ctrl+Shift+Enter when exiting cell edit mode (instead of just enter).
=AVERAGE(IF($A$2:$A$13=A2,$B$2:$B$13))
Then copy down for all rows.

Index Match Match across multiple columns

I have an Index Match Match question that I have not been able to find the answer for in researching. Although the solution may actually might be different than an Index Match Match formula - I'm open to try something more efficient than my current workaround.
I have one worksheet with data from my company on it. We sell a Product (let's call it Coke Zero) and we track the weeks that we put a promotion on and how much profit we make by selling it to the retailer. For example a promotion for Coke Zero starts the first week of Jan and ends 3 weeks later and we make a gross profit of $100 each week the promotion runs. I then have an external database with sales data formatted on a weekly basis to tell me how many units of Coke Zero I sold in each week. My internal data has thousands of lines like this with dozens of products, however the promotions are consolidated on one single row regardless of if it runs for more than one week, making matching up to the external database difficult. I need to create a lookup for what our Gross Profit was for each week of the promotion.
I have attached an example image of the workbook + two data sheets of what I've tried to do, summarised below.
On the Internal Data Sheet I've created additional columns to the right with all of the weeks listed that the promotion is on for, and concatenated them with the Product Code to be able to match week by week to the data in the External data sheet. Then my lookup basically checks every column one after another until it finds one where the concatenate of Week_Product Code concatenate matches.
My current solution technically works but my final formula is really slow and cumbersome given the data can be anywhere from 10K-200K lines when looking at multiple retailers. I was hoping to find a more efficient formula to complete the lookup.
Current solution on the External Data Sheet Column E:
=IF(ISNUMBER(MATCH(D2,'Internal Data'!$E:$E,0)),INDEX('Internal Data'!$D:$D,MATCH(D2,'Internal Data'!$E:$E,0)),
IF(ISNUMBER(MATCH(D2,'Internal Data'!$F:$F,0)),INDEX('Internal Data'!$D:$D,MATCH(D2,'Internal Data'!$F:$F,0)),
IF(ISNUMBER(MATCH(D2,'Internal Data'!$G:$G,0)),INDEX('Internal Data'!$D:$D,MATCH(D2,'Internal Data'!$G:$G,0)),
"0")))
I got SUMPRODUCT to work using this formula in J2:
=SUMPRODUCT(--($B$2:$D$3=H2)*--($E$2:$E$3=I2)*$F$2:$F$3)
And, you don't need those concatenated lookup columns:
Well, that was fun.

Marking an Excel Spreadsheet with a value range

I teach a budgeting course for my professional association. As part of that course, students are required to submit a draft budget as part of their marks. The budget template that I have to use is kindof set in stone. The association offers it's courses at various college locations and I can't just arbitrarily change it's contents.
That being said, marking this assignment is a pain in the neck! I'm looking for an easy way to be able to compare the values in a cell, and then mark it correct or incorrect, if it is within an expected range..
For example, students are required to estimate the expenses for the current year. If their estimate is within $200 +/- of what the answer key states, then I would mark their answer correct.
I am not a coder by trade, but rather an armchair coder who will search out and self teach what I need to solve my problem, so I'm not afraid of a bit of homework myself. I have not been able to find any solution so far. Right now, my students submit their assignment hardcopy, and I manually mark their spreadsheets. Tedious to say the least. Any searches I try to perform for academic marking of an Excel spreadsheet only return solutions to use Excel as a tracking tool for student marks, which is not what I'm looking for.
My college uses Desire2Learn as their online platform for content delivery, and students can submit their material electronically, I want an easy way to determine if they have completed the spreadsheet correctly.
Any help, or pointers in the right direction would be greatly appreciated!
There are probably several ways to tackle this problem but this might be something simple if the layout of the sheets doesn't change. You could create a worksheet with 3 sheets.
1. a sheet to copy their work into
2. "Master" sheet with the correct answers
3. "Grading" sheet that has formulas that calculate the difference (possibly within a range). For example IF(ABS(Sheet 1!B20 - Sheet 2!B20)>200,"Correct","Incorrect"). Calculates the absolute value of the difference between the same cell address on 2 different sheets then compares to the expected answer and returns Correct or Incorrect.
You would still have to copy their work into your master worksheet one at a time. Remember this only works if their worksheet layout doesn't change.
Post a rely along with a sample of the data if you need something more flexible.

Google Apps Script: Compare One Cell to Another, then Increment Cell Value

I'm not very experienced in programming, but I'm looking to do something specific with my Google Sheets document. As an example:
I buy fruit buy the box. Each type of box has a
certain amount of each fruit.
My customers have standing orders for
differing numbers of certain fruit platters I sell.
I need to figure
how many of each fruit box I need to buy to fulfil each customer's
order, with a minimum of wastage.
I keep running into circular dependancy errors when I try to work things out with my limited spreadsheet knowledge. Ideally what I'd like to do is have a script that:
Increments the "Amount to Buy" of Fruit Box #1 by 100 (they come in pallets of 100, I can't buy less)
If the amount of fruit with the best yield for that box (highlighted in green on the "Fruit Boxes" sheet. Fruit Box #1 is Cherry) is met, then the sheet moves onto the next fruit box.
At the moment I am able to get the sheet to tell me how much of each fruit box I need to buy to have enough of the "best yield" fruit that box contains, but I need it to take into account that the other boxes I need to buy also may contain some of that fruit.
My example sheet is here >> https://docs.google.com/spreadsheets/d/1tbI89jfY2ddAlyTN5VGaQ3nSRsgJcuR6Ev3I-YIdUoA/edit?usp=sharing
Note: Bonus points for anyone who can suggest a better way of displaying how many of each platter each customer requires. At the moment I'm using a very long and clunky IF, THEN statement in the "Required" column for each fruit platter, but I'm sure there must be a better way.
Thanks in advance for any help you can provide.
I'm not sure this is a Google Apps script question - are you planning to code a solution in Javascript, or are you happy to just use normal spreadsheet functions? I suspect the later, in which case you may be better off asking in https://webapps.stackexchange.com/questions/tagged/google-spreadsheets
Some functions that may be relevant to explore include SUMIF, SUMPRODUCT, HLOOKUP and VLOOKUP. I'm not sure I fully understand your question so I can't help you more!

Resources