Is there a formula that takes the adjacent cell to the top 10 values and deals with identical values? - excel

In order to better analyse pages over time for SEO optimisations and rankings, I've made an excel spreadsheet that pulls in the top 20 pages by impressions and compares it to the top 20 pages by clicks.
I download the report for pages from Google Search Console and copy it into a sheet called PageDataInput. In a sheet called Page it pulls the top 20 pages according to the key metric chosen, either impressions or clicks
The table for impressions works without issue because there aren't any duplicate impressions and there is a low likelihood that there will be. However, this isn't the same with clicks.
Instead of referencing the next page with the same value, it just references the same page with that click for as long as there are duplicate values. Meaning that if there are 5 pages with the same click value, it'll reference the first page 5 times and then move on to the next page.
For Impressions I've used:
=INDEX(PageDataInput!$B$2:$B$952,MATCH(1,INDEX((PageDataInput!$D$2:$D$952=LARGE(PageDataInput!$D$2:$D$952,ROWS(B$2:B2)))*(COUNTIFS(B$2:B2,PageDataInput!$D$2:$D$952)=0),),0))
For Clicks I used the same code just different column to check:
=INDEX(PageDataInput!$B$2:$B$952,MATCH(1,INDEX((PageDataInput!$C$2:$C$952=LARGE(PageDataInput!$C$2:$C$952,ROWS(I$2:I2)))*(COUNTIFS(I$2:I2,PageDataInput!$C$2:$C$952)=0),),0))
The columns are all set correctly.

To deal with duplicates with respect to the amount of clicks you can create a new column which adds an incremental amount to the number of clicks and reference this column instead.
The easiest way to do this is by adding a very small random number:
+RAND()/100000
This will not really change the results but the LARGE function will work fine as the numbers are now essentially distinct.

Related

How can I "tie" data from a manually input, static cell to a cell that changes regularly?

I've to keep track of restaurants' opening times on bank holidays. I have a spreadsheet that takes data from our API which gets updated several times a day. Then I have another column, where I'd like to input manually whether said restaurant is open/closed.
Since the restaurant list updates several times a day and the opening column is static, this doesn't work. I want to tie the opening time to the restaurant's unique ID, so when the data from the API refreshes, the manually input data goes with it too.
Picture of spreadsheet
Columns A-C are dynamic, D is where I want to track if they're open or not.
E.g.: Restaurant with ID 13 moves to the place of ID 18 because the restaurant goes inactive, I want "Closed" from column D to go with it. If D remains static it would say "Open", which is incorrect.
I'm probably just bad at Googling, but I couldn't figure out how to do this.
Note: I'm trying to do this in Google Sheets.

Excel Multiple value look up and multiple results

I have a list of Tasks: Portfolios, Programme of works, Projects, etc.
i have a document number that starts TMO-
These are in a long list TMO-1,TMO-2 etc with each one being associated to a Task title.
The photo below shows the fist few. In column AA and AB i have started to create some filters to see what portfolio number, and POW they are linked to. IN column AC there is a list of TMO-1, TMO-2 etc links for each line.
The issue is some of them have multiple values and i cant get that to work.
My working so far has been to separate the lists into lines as shown (so i took the list in column AC and split it into separate rows on a different page for clarity) i then used Text join to search. The search criteria for this i kept on a separate page also which was all the portfolios which go from TMO-1 to TMO-7 also shown:
As stated above the issue comes when looking at programmes of work POW as projects have multiple POW's. Once the Value is found in the finder tabs its just shown on the main output tab using =(to the cell on the finder)... any ideas ?

Search formula for best text match among two excel lists

I have a long list of products (+20,000 items) of surgical instruments. Sometimes I receive requests for different names of these products which is impossible to manually match in my list.
I was thinking of a formula to find or suggest the closest result of match for the common words in each cell.
I have created this formula:
=INDEX('Products'!G:G,MATCH((("*"&LEFT(A2,5),'Products'!G:G,0))
(where Products G:G refers to my long list.
it gave some results correctly but more than 80% of the result came back with false results.
please see the attached image to show you the result.
is there is a way I can get more accurate result?
or I was thinking of finding major category of each item such as:
Category 1: Scissors, Retractors, Knives, etc.
Category 2: Straight, Curved, Angeled, etc.
Category 3: Sharp, Blunt, etc.
Category 4: 10mm, 130mm, 24cm, etc. (size)
which is easy for me to do it.
then use the same formula but with referring to the common words..
something like:
=INDEX(Products!G:G,MATCH("*"&LEFT(E2,5)&"*"&F2&"*"&G2&"*",Products!G:G,0))
where E2, F2, G2 refers to the categories..
I tried but it gave false results as well.
I urge you in the strongest sense of the word to spend some time creating a good quality master table and then spinning off 1 table for each category.
make use of clean(), trim(), proper(), heck, if you need to copy the data in notepad++ and enable view all symbols then switch between ansi utf utf8 wtf omgwtf or any other encoding to ensure you dont have any hidden special characters than do it.
you have 4 categories, so that's 4 1 column tables. name them. no duplicates. no trash. no junk. sort your data. nice clean names/words/whatever you categorize by. if you absolutely must add an index or key column then go ahead but do yourself a favor and stop there. use a different table to deepen your relationships.
next step is to to create comboboxes. i'm not sure why but the combobox in excel is not the same combobox in the vba editor. you want the one in the editor. you can make a fancy user form or you can make a minimalist text box design. whatever you fancy. just make sure the combobox has a field for RowSource in the properties. for whatever reason i don't get that option if i am not in the vba editor when i create the box.
you're almost gauratneed to want drawmodal = false on every user form you make for these boxes
you probably really don't need more than 4 boxes but it depends what you're doing so that's up to you. name your combo boxes.
verify each box has: matchentry = 1-fmMatchEntryComplete
i recommend: style = 0 - fmStyleDropDownCombo
this will allow you to begin typing and autocomplete the first match and also let you select from a drop down list, starting with the the first match of the name you've typed.
you can set the number of elements in the list. default is 8. if you have a slow computer than i wouldn't push it much. if you have a best then give it a shot.
you can also change fonts for easier reading and a bunch of other format changes.
now the this is the most important part - RowSource will be one of those 4 tables
now that i've given instructions, let me explain why. some businesses don't have the best practices and i'm currently with one that's using an oracle erp solution for data management but the front end isn't used. data entry is done in excel and loaded into oracle using batches. lookups in oracle continue to be a psychological barrier for the ap/ar teams so i did exactly what i suggested here but took it a few steps farther.
i pulled the vendor master and i pulled teh customer master
i cleaned the data and compiles simple pure clean 1 column tables
then i created a form for the comboboxes
first came ap with vendor name
then vendor number
then vendor remittance location
our orderering facility number
selecting a vendor name populates the vendor number box with the possible vendor numbers. same for remittance location and ordering facility
i pulled a year's worth of transaction data and created a gl table. some vendors have only ever used 1 gl acount. some several. there's a % number next to each gl. that represents the value of transactions posted from that vendor to that gl for the last year.
next up a date picker and text boxes for invoice fields.
get it nice and tight on a form, set the tab stops, add a commit button and all of a sudden we have a front end excel platform that performs better than oracle - because people use
i haven't finished the ar side but it'll get done and i'll the angels will be rejoicing and singing my name for years to come.
1:1 matching with autofill and drop down functionality you can't beat it. that's what you get with my suggestion.
best of luck!

Create an Excel Formula that uses filtered data

I'm trying to design a second page that shows % results of my data on page 1.
For example, Column F & G allow manual entry of numbers 1-4 which are based off data the user types in at another location.
This is being used for trade tracking in investments so there will be quite a few numbers but the end result will be a row will show a specific stock, it's subsequent data, whether it made or lost money, etc.
What I want to do in page 2 is using the numbers 1-4 which were typed in at columns F & G, translate that into an edge on page 2.
For example, if there were 50 columns of data typed out for trades executed, I could take the number of winning trades of a certain setup (say number 3) and divide that by the total trades of 50 to come out with a win % for that setup.
However, I have no clue to how to translate that forumla into a filter formula so that on page 2 I could see that of the numbers 1-4 (4 different setups) I could easily see the highest and lowest win % to determine the best setup to use.
I'm not the best in excel but I understand enough to code most of that, I simply have no idea how to take that end formula and add a filter to it so that it only uses partial results. I've got 4 other formulas I want to use on page 2 as well to help build something that could really benefit myself, but if someone could just show me how to filter data into a formula, I think I could take it form there.
Thanks for the help
Ben
You can also do something like this with array formulas
=MAX(IF(Sheet1!$F$2:$F$50=$A2,$E$2:$E$50))
(Press Ctrl+Shift+Enter [CSE], instead of just Enter when entering Array Formulas)
Also, take a look a the SUMPRODUCT function. It comes in very handy for filtering data. Here are some helpful links...
https://www.get-digital-help.com/2017/12/07/sumproduct-multiple-criteria/
https://www.get-digital-help.com/2017/12/08/sumproduct-and-if-function/
https://www.get-digital-help.com/2010/09/01/extract-a-unique-distinct-list-by-matching-items-that-meet-a-criterion-in-excel/

How can this lookup (find the last relevant item) be improved?

One of the reports that wastes a bunch of my time at work is the Roster. It's a multi-site, multi-contract listing of every employee currently assigned to a specific client. Currently, it has a little over 6,000 lines by 20-something columns, indexed against 3 different datasets. Not the largest mess in the world, but still a pain. And it's almost all in excel, because I somehow don't have a business case for Access.
But one part of this monster stands apart. One tab per site Site Totals, listing off every time any agent has gone through training. A second tab (again, one per site) Site Data displaying only the most recent training class, and the credentials they had during that class.
That second tab is driven by variations of this array formula - Last_Row is a named range on another tab, and column A is a pivot of the UID column on Site Totals. I've broken it apart for readability:
=IF(INDEX('Site Totals'!B:B,LARGE(($A2=INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row))*
(INDIRECT("'Site Totals'!B1:B"&Last_Row)<>"")*
ROW(INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row)),1))="Trainer",
"",
INDEX('Site Totals'!B:B,LARGE(($A2=INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row))*
(INDIRECT("'Site Totals'!B1:B"&Last_Row)<>"")*
ROW(INDIRECT("'Site Totals'!$A$1:$A$"&Last_Row)),1)))
I know what this formula does, but I don't know how to improve it. This formula needs to be changed, because it currently is on the order of 500 Million calculations (I'm not allowed to delete historical data), and it takes me 3 hours to calculate the workbook ... if it doesn't crash Excel first.
I'm open to VBA and / or custom functions, but would prefer to have native Excel functions. I'm not able to install anything, so any solution must be native Excel, and Must be compatible to Excel 2007.
If your source is a pivot table, try is the GETPIVOTDATA function. You might be able to accomplish what you want without INDIRECT and INDEX.
What i have understood is that every person has/has not attended a training and you want to retrive the name of that training, in case he has not, you want a blank space in the cell. If this description is correct you can try this formua, press ctrl+shift+enter to execute.
=IFERROR(INDEX('Site Totals'!B$1:B$12,MATCH(A2&"Trainer",'Site Totals'!A$1:A$12&'Site Totals'!B$1:B$12)),"")
Here A2 contians the name of the person. I can be more precise with this formula if you can provide some sample data butI would recommend to not to use entire B & Columns in Site Total workssheete as this will definately slow down computing process, instead you can use B1:B8000 or smaller range, to speed up process. Hope that helps.

Resources