Excel VLookup and List - excel

I am trying to list all of the unique occurrences of one cell on a table and then list them.
TABLE 1
PLACES WEEK
| Place 1 | Week 2 |
| Place 1 | Week 2 |
| Place 1 | Week 2 |
| Place 1 | Week 3 |
| Place 2 | Week 2 |
| Place 2 | Week 3 |
| Place 3 | Week 2 |
| Place 4 | Week 3 |
| Place 4 | Week 3 |
| Place 4 | Week 3 |
So on another sheet I want a list of all Places that are in week 2 but I only want one occurrence of each. The result being from this that I would get.
| Place 1 |
| Place 2 |
| Place 3 |
but not place 4 on my list.
Is this possible with a formula.
Thanks,

If you ok with spaces this is the first thing to come to mind
=IF(AND(Sheet1!B1= 2,$A$1:A1 <>Sheet1!A1),Sheet1!A1, "")
When you enter it, enter as array (Ctrl + Shift + Enter), make sure you get "{}" Surrounding the formula then drag down. And make sure to start in the second row of the column.

Related

Formula to multiply all rows in a column after adding 1 to each one of them, and subtracting 1 after all of the products

How can I automate this formula to a large number of cells without needing to manually summing them?
I want to add 1 to each row in a column and then multiply it by the other rows with the same criteria, and after all, I want to subtract 1 of the total value, like this:
=(C2+1)*(C3+1)*(C4+1)*(C5+1)*(C6+1)-1
google-sheets only:
PRODUCT of C2:C6+1 enforcing array context with ARRAYFORMULA:
=ARRAYFORMULA(PRODUCT(C2:C6+1))-1
THis should work:
=EXP(SUMPRODUCT(LN(C2:C+1)))-1
You can do this using two helper columns, where the first one contains the product, and the second the product minus one:
| A | B | C | D | E
==+===+===+====+============+======
1 | | | | 1 | =D1-1
2 | | | x1 | =D1*(C2+1) | =D2-1
3 | | | x2 | =D2*(C3+1) | =D3-1
4 | | | x3 | =D3*(C4+1) | =D4-1
5 | | | x4 | =D4*(C5+1) | =D5-1
Dragging the formulas down should fill them in as expected. Column "E" contains the information you're looking for.

Finding the average transaction, per user in Excel. With two criteria to satisfy (user match and month match), each row is a transaction?

I am encountering something I am finding challanging to understand how to script and I was hoping maybe someone who has better excel knowledge may be able to help!
UserID is in column A, and DateofTransaction Is in column I,
I have a code that identifies any change between user id or Month as a 1 else 0. :
ENTERED INTO COLUMN O
=IF(A2<>A1,1,IF(I2<>I1,1,0))
if the ids are Not the same then 1, if the ids are the same then it checks if the months are not the same then 1 too, if both are satisfied then a 0.
Then to try to create some logic where it can group each set I have written
Column O is the
=IF(O2+O3=2,1,IF(O2=0,IF(O3=1,2,IF(O2+O3=0,Q1+1,null))))
Which just identifies the groups of months but unsuccessfully at the moment, What I am looking for is Blank cells if it is not the only one in the month for the user. example excel below
Column A | Column I | Column O | Column Q | Column R |
----------------------------------------------------------------------------------------------
user id | date | 0 or 1 match | transactions per month| Transacting month count
-----------------------------------------------------------------------------------------------
1 | Mar-16 | 1 | 1 | 6
1 | Apr-16 | 1 | BLANK | 6
1 | Apr-16 | 0 | 2 | 6
1 | Aug-16 | 1 | 1 | 6
2 | Aug-16 | 1 | BLANK | 1
2 | Aug-16 | 0 | BLANK | 1
2 | Aug-16 | 0 | BLANK | 1
2 | Aug-16 | 0 | 4 | 1
I will then need to do an Average transactions per month for each user over their lifetime individually. The transacting month count was created with a LookUp to calculate their relative month count.
Any suggestions would be greatly appreciated!
Thanks,
C
Here is the formula that you can use for your question regarding formula in column Q:
=IF(O2+O3=2,1,IF(OR(AND(O2+O3=0,O3<>""),(AND(O2+O3=1,O2=1))),"",COUNTIFS(I:I,I2,A:A,A2)))
Put this in Cell Q2 and drag it down till you have data.

Show top 3 from list based on difference

I have 2 lists;
"yesterday" and "today".
As rows I have a list of companies and the data shown is customer satisfaction going from 0-10. I want to show the top 3 companies that has the best difference between "yesterday" and "today".
How would you approach this??
Expected output looking for top 1:
Yesterday - Today
Company A: 5 10
Company B: 7 8
Company C: 8 6
Top 1: Company A (Since they moved the most(5 positive points))
Assuming your data is like this:
#########Sheet1<YESTERDAY>########
| A | B |
1|Companies| Customer satisfaction|
2|Company1 | 6
3|Company2 | 3
4|Company3 | 4
5|Company4 | 1
6|Company5 | 9
###########Sheet2<TODAY>##########
| A | B | C | D |
1|Companies| Customer satisfaction|Absolute changes | RANK |
2|Company1 | 1 | | |
3|Company2 | 7 | | |
4|Company3 | 7 | | |
5|Company4 | 4 | | |
6|Company5 | 8 | | |
Put this formula into Cell C2to get absolute change:
=ABS(VLOOKUP(A2,YESTERDAY!$A$2:$B$6,2,FALSE)-B2)
Put this formula into Cell D2to get Rank:
=RANK(C2,$C$2:$C$6,0)
So, 1,2,3 in Column RANK are best changes.
I assume best difference as highest difference.run a loop and take the first row company from yesterday as well as the customer satisfaction value and search that same company in today in another inner loop and find the difference of the two values and save it in an array.After that sort the array and display the top 3.

Can I populate a column with conditional data while omitting empty rows or possibly autosort?

In one spreadsheet document, file.xlsx, I have 2 sheets. Sheet1 has the editable fields. Sheet 2's sole purpose is to read the data from Sheet1.
The point is to keep track of inventory and easily display items needed to be ordered.
Sheet1 'column a' is item number for ordering
Sheet1 'column b' is the number I have on hand
Sheet1 'column c' is the formula cell to find the number needed to be ordered
It looks something like this:
Document1:sheet1
A | B | C |
1 |txt1 | 1 | =10-b1 |
2 |txt2 | 0 | =10-b2 |
3 |txt3 | 13 | =10-b3 |
4 |txt4 | 5 | =10-b3 |
5 |txt5 | 2 | =10-b4 |
There is some if statement conditional formatting in the "C" column to check if the "B" column has a value HIGHER than 10 and if it hits true then the corresponding C cell is blank but for space, i'm summarizing here
Document1:sheet2
A | B |
1 |=if(sheet1!C1>0,Sheet1!A1,"") |=if(sheet1!C1>0,Sheet1!C1,"") |
2 |=if(sheet1!C2>0,Sheet1!A2,"") |=if(sheet1!C1>0,Sheet1!C2,"") |
3 |=if(sheet1!C3>0,Sheet1!A3,"") |=if(sheet1!C1>0,Sheet1!C3,"") |
4 |=if(sheet1!C4>0,Sheet1!A4,"") |=if(sheet1!C1>0,Sheet1!C4,"") |
5 |=if(sheet1!C5>0,Sheet1!A5,"") |=if(sheet1!C1>0,Sheet1!C5,"") |
If an item isn't to be ordered because stock is high, it doesn't show up in the list. This is ok. It looks like this:
Document1:sheet2
A | B |
1 | txt1 | 9 |
2 | txt2 | 10 |
3 | | |
4 | txt4 | 9 |
5 | | |
What I would like to see is:
Document1:sheet2
A | B |
1 | txt1 | 9 |
2 | txt2 | 10 |
3 | txt4 | 9 |
4 | | |
5 | | |
For 5 Items in the example, it doesn't seem that annoying, but in actuality I have 1200 potential rows and it varies between 200 to 800 actually populated each time i conduct inventory. The whole point is to have one continuous section of rows that I can select and print. Maybe some way of autosorting and placing the empty ones on the bottom?
I've taught myself excel. I don't know the advanced tricks and things.
I'm a typically a programmer but I've been tasked with this project and the guys upstairs want me to do it in excel.
i've overcomplicated this, to the max.
a simple sort putting the empty's at the bottom is the resolution.
not quite as automated as i'd like
but
it works.

Counting the frequency of combinations of numbers (in excel using VBA)

I want excel to count the FREQUENCY that certain number-letter combinations appear down a column in excel (using vba). All my data goes down one column like this:
Column A (only 1,2,3,4,5,s,f appear)
1
2
s
4
3
s
4
2
f
2
s
2
s
I want to count the number of occasions combinations of (1-s, 2-s, 3-s, 4-s, 5-s) occur, strictly when the number occurs first (is in the higher row). I do not want to count occasions when the s comes before the number (e.g. s-2). I know how to count the number of individual letters/numbers using the countIf function.
I might later want to expand my analysis to look at the occasions that three letter-number combinations (e.g. 2-s-3, 2-s-5)
I am very much a VBA noob.
Try inserting a new column to the right of Column A. Use this formula =A1&A2 and fill it down the column. The values will look like this:
+----------+----------+
| Column A | Column B |
+----------+----------+
| 1 | 12 |
| 2 | 2s |
| s | s4 |
| 4 | 43 |
| 3 | 3s |
| s | s4 |
| 4 | 42 |
| 2 | 2f |
| f | f2 |
| 2 | 2s |
| s | s2 |
| 2 | 2s |
| s | s |
+----------+----------+
Now you can count occurences like you were doing before! :D
Of course, you can expand to three character frequency analysis by making the formula =A1&A2&A3.
Seems possible with COUNTIFS, with 1 to 5 inclusive in C1:G1 and in C2:
=COUNTIFS($A1:$A12,C1,$A2:$A13,"s")
copied across to suit.
You can use the VBA equivalent of this formula
=SUMPRODUCT(--(ISNUMBER(A1:A12)),--(A2:A13="s"))
which looks for number, followed by s in the row below (4 for your sample)
code
MsgBox Evaluate("SUMPRODUCT(--(ISNUMBER(A1:A12)),--(A2:A13=""s""))")

Resources