Let's say I have some data I generated through a window function (lifetime_clicks)
I want to know in excel or google sheets pivot table if can get the % of lifetime clicks come from today_clicks (hour_clicks / lifetime_clicks)
user_id date hour_clicks lifetime_clicks
1 02 30 90000
1 02 2 90000
1. 02 200 90000
1. 03 4544 90000
I would like to group the data on date and sum(hour_clicks) and divide that by 90000, but everytime I enter lifetime_clicks to the calculated field, it sums the data.
is there a way to distinct sum(lifetime_clicks) to prevent such a thing from occurring?
I would like to group the data on date and sum(hour_clicks) and divide that by 90000
Easiest option is adding a HELPER column, like my column E in image above. Formula is just =C2/D2
Second option, if you are going to divide always by 90.000, then you could use a Calculated field.
To be honest, I think easiest way would be helper column.
Related
My data looks some thing like this:
Product 1
Date
Site1_Sales
Site2_Sales
Site2_Sales
x1
1-Jan
100
200
300
x2
2-Jan
60
51
150
X1
2- Jan
110
30
40
There will be 1000s of rows with repeated Product but with unique dates. This is what I would like to find:
What was the Max sales for a product ? and on which date ? I tried using Maxifs but it ends up with value error it looks it can handle only continuous ranges.
What was the sum of sales for a product for specific period e.g first 10 days ?
Any help is really appreciated. Thank you
see “Remarks” about #value error:
https://support.microsoft.com/en-us/office/maxifs-function-dfd611e6-da2c-488a-919b-9b6376b28883
SUMIF works in the same way as MAXIF (e.g. you could use a start date and end date as multiple criteria)
FILTER should help you to find the date(s) of max. Sales as well
I have Start date + time and End date + time in table 1, then i have a range of dates and values in table 2. what i want is to find the highest value from table 2 that happened in the date range from table 1.
For example in table 1:
start date 12/30/2020 08:03 ; end date 12/31/2020 17:26
in table 2 is:
12/30/2020 08:00 1145
12/30/2020 09:00 2145
12/30/2020 10:00 3912
12/30/2020 08:00 1472
and so on. so in the row of table 1 i want to see the number 3912
Suppose both of your tables are structured reference table as shown below:
You can use either of the following formula to return the desired value:
=MAX((Table2[Date]>=Table1[#[Start Date]])*(Table2[Date]<=Table1[#[End Date]])*Table2[Value])
This one is using MAXIFS as suggested by Nicholas Hunter in the comment section:
=MAXIFS(Table2[Value],Table2[Date],">="&Table1[#[Start Date]],Table2[Date],"<="&Table1[#[End Date]])
Assuming table 1 = A1-B10 and table 2 is in D1-10,
try making another column (lets say F1-10) with the following: =IF(And(D1<B1,D1>A1),D1,0)
and in whatever cell you want the highest Date, put =Large(F1-10)
Make sure that the final cell has "Date" format, otherwise it will look like a weird number. if you want to look at the intermediary steps, do the same for F1-10.
interested in converting a transaction statement like so:
Date (DD/MM/YY)
Stock
Flow
11/12/20
Apple
200
12/12/20
Microsoft
50
13/12/20
Apple
-100
into something that looks like:
Date (DD/MM/YY)
Apple
Microsoft
10/12/20
0
0
11/12/20
200
0
12/12/20
200
50
13/12/20
100
50
14/12/20
100
50
Appreciate tips on the best way to go about doing so as I'm not quite sure how to approach this, thanks.
Formulas: (using O365) slightly different approach may be needed in other versions
*note that I created a table out of your stock flow data
F1: Date
G1: =TRANSPOSE(UNIQUE(stockFlow[Stock]))
F2: =ROW(INDEX($A:$A,MIN(stockFlow[Date])-1):INDEX($A:$A,MAX(stockFlow[Date])+1))
G2: =SUMIFS(stockFlow[[Flow]:[Flow]],stockFlow[[Stock]:[Stock]],G$1,stockFlow[[Date]:[Date]],">="&$F$2,stockFlow[[Date]:[Date]],"<=" & $F2)
Select G2 and fill down and across as needed.
Use a Pivot table - create a pivot table, Make "Date" a row and "Stock" a column. Then make "Flow:" a value and change the "Value Field Settings" to "show values as" a "Running Total In..." with "Date" as the base field.
Note that the pivot table will not insert dates that aren't in your raw data, but you could insert rows for the missing dates with a zero flow for any stock to get the table you want:
I'm setting up an excel data table that i need to make a monthly statistics from it. how can i automatically choose a characteritic from the table and get all its values sumed up ?
This is a garage based data, that includes daily entries and the productivity of every technicien on a daily basis. What i'm asking for is, can i find a way to sort all 5 techniciens in a different table and get their productivity summed up automatically ?
here is the data table and an example for what i am trying to do.
n Date CLIENT Date d'entrée MO Techniciens HT€ Prestation
1 01/03/2019 YAYA 01/03/2019 30 900 FLORENT 30 900 Passage au banc
2 05/03/2019 DAVID 05/03/2019 30 000 LOBA 30 900 Passage au banc
3 07/03/2019 NAME 20/02/2019 60 000 YAPO 60 000 Ctrle injecteurs
4 08/03/2019 MATFORCE 01/03/2019 39 000 LOBA 42 151 Passage au banc
what i want is to have another table with the techniciens name in it and the sum of HT€
technicien heures factures/mois
PRINCE 10 000
MOUSSA
ETIBOIS
Select Data
Insert -> Pivot Table
Set Technicians as Rows and Sum of HT as Values
Source data was slightly altered to better illustrate the answer
Like #Marc in the comment to the question, I would suggest SUMIF(), SUMIFS() or Pivot Tables.
Pivot Tables are the easiest as they can SUM by multiple criteria without a lot of programming. But they only do one thing at a time so SUM and AVERAGE need to be done separately.
SUMIF(range,criteria, sumrange) will return the sum of all of the cells in sumrange that are in the same row where the value in the range meets the criteria for example:
=SUMIF(A1:A999,="Charlie",B1:B999)
Where A1:A999 has the technicians' names, B1:B999 has their billing amounts
SUMIFS() is similar but allows multiple selection criteria.
If I'm trying to find specific names in a list given from my pivot table such as -
Row Labels Revenues Order #
Panera 25 0
Pasta 15
Salad 10
Olive Garden 40 0
Sandwich 20
Pasta 20
Panda Express 30 0
Rice 15
Chicken 15
And I want to search through my document, find Olive Garden and Panda Express and I wanted to replace the 0 in the order # column with 10 for Olive Garden and 20 for Panda Express. Currently, someone here helped me out with
=IF(IFERROR(VLOOKUP(A9,worksheet!K:K,1,FALSE),"")="","",0)
which inserts 0's for the headers and blanks for the orders in the 'Order #' column, can I add a second formula that would find the names and replace the value in that column? Or adjust the current formula?
Quick note - order # column is not from the pivot table.
To make it more clear, - I am getting data from an external source (i.e. paper invoices), as opposed to making a manual entry to adjust the 0's in the order # column, I would like to tell VBA/Excel - "hey Olive Garden's order number is 10 and Panda Express's order number changed to 20, adjust".
this is my end goal -
Row Labels Revenues Order #
Panera 25 0
Pasta 15
Salad 10
Olive Garden 40 10
Sandwich 20
Pasta 20
Panda Express 30 20
Rice 15
Chicken 15
If you have a range with the restaurant names in one column and the order numbers in the next column (say columns X and Y of the sheet called "worksheet"), you could change your formula to be
=IF(IFERROR(MATCH(A9,worksheet!K:K,0),"")="","",IFERROR(VLOOKUP(A9,worksheet!X:Y,2,FALSE),0))
(P.S. Changed the original VLOOKUP to MATCH based on useful feedback from teylyn.)
FWIW, that formula would be better using MATCH, not VLookup, since it's returning the value from the first column.
But back on track: what are you trying to achieve? Change the values in a pivot table?
First, a formula cannot change values in another cell.
Second, a pivot table reports on existing data. You can't change the numbers that a pivot table reports.
You will need to re-think your approach. If you don't like the numbers the pivot table returns, you'll need to change the underlying source data.