I have an Excel Workbook... in Column 'F' is a list of 95 companies, in random order through time, as they have submitted tickets.
3174 of them.
In column 'I', are the SUBJECTS of these tickets.
375 of them.
I want to know how I can get the most common occurrence for each subject, as submitted by each company.
If company 'ACME' in Row 15, occurs 89 times throughout the 3174, of those 89 times, which of the 374 subjects occur most frequently?
Thank you.
D.Pierce
Use this array formula:
=INDEX(B1:B8,MATCH(MAX(COUNTIFS(A1:A8,"comp1",B1:B8,B1:B8)),COUNTIFS(A1:A8,"comp1",B1:B8,B1:B8),0))
Being an array formula it needs to be confirmed with Ctrl-Shift-Enter instead of Enter when exiting edit mode. If done correctly then Excel will put {} around the formula.
Related
Working in Excel365, what would you say is the most resource-effective formula for building an index from percentage changes?
Assume you have a time series of percentage changes of any variable (e.g. daily changes in a stock price) in A2:A1000 in the form of a dynamic array, and you want to build an index starting at 100 in column B. In its simplest form, you would enter 100 in B1, enter B1*(1+A2) in B2 and copy that formula down to (in this case) B1000. But how would you suggest to do this in the most resource effective way, so that B1:B1000, or at least B2:B1000 becomes a dynamic array following the length of A2#, i.e. if A2# is 2345 rows (instead of 999 rows as in the example above), B1# becomes 2346 rows (or B2# 2345 rows if that solution is simpler)?
I do not have access to the values of the underlying variable, only to the percentage change, and I have many columns I need to build indexes for, therefore it is preferable if it is as resource-effective as possible.
Thanks a million for any ideas!
Kindly,
Johan
P.S. Using OFFSET() to get a dynamic array doesn't work, since the calculation is iterative (index value at t+1 is dependent on the index value at t), thus yielding a circular reference error. Instead I have tried BYROW() with LAMBDAs without much success and I'm not convinced that they are very resource-effective anyway. A seemingly simple problem that has thrown me into a dead-end street...
I'm facing a bit of trouble right now with a data task I'm working on. Basically I have some financial data in data tables (a data table with calls bought and their info, and a separate data table of puts bought and their info)
Calls Data Table:
User
Ticker
Timestamp
Strike
Expiration
Type
1
META
"2022-06-14 00:00:10"
160
"2022-07-01"
Call
1
META
"2022-06-14 00:00:18"
160
"2022-07-01"
Call
1
META
"2022-06-14 00:00:23"
160
"2022-07-01"
Call
Puts Data Table:
User
Ticker
Timestamp
Strike
Expiration
Type
1
META
"2022-06-14 00:00:23"
160
"2022-07-01"
Put
1
META
"2022-06-14 00:00:25"
160
"2022-07-01"
Put
1
META
"2022-06-14 00:27:00"
160
"2022-07-01"
Put
I'm trying to calculate the total number of straddles (defined as a combination of put/call with same expiration, same strike price, same user, AND within 10 minutes of each other.) and know which combination of call/puts create straddles. In the example above, there are only 2 straddles, and the first call is paired with the first put, second with second, but the third put occurs more than 5 min away from the third call, so it doesn't count as a straddle.
So far what I've done is a cross-join the two tables, and I have been able to get ALL combinations of calls and puts (which is an enormous number). Then I filter to only those where the absolute difference in the timestamp is less than 10 minutes as follows:
straddles <- calls[puts,on=.(account,ticker,strike,expiration),allow.cartesian=TRUE]
straddles_10min <- straddles[abs(timestamp-i.timestamp)<=600]
This now gives me all possible combinations of puts and calls within 10 minutes, but in this case it gives me 4 straddles, as both calls and puts 1-2 can go with each other. Not to mention, it's incredibly inefficient as I'm getting way more matches than I need and storing them.
The way I can think of solving this is with lists as follows:
Go through list of calls
For each call element, see if there's a corresponding match in put list
If there is a match, pop the call item AND the put item, and store them in a new table
Go through entire list; at the end you'll have the unmatched options in both lists AND a new list with the matches.
This sounds very simple to do with lists, but I'm honestly stuck and how to do this with Data Tables, and if there is a way to do it with a Join where only the first element is matched but NEVER repeated.
Sorry if this sounds confusing, it's a bit difficult to explain in text and it's my first time asking here!
I have a data frame that contains a column of total ads shown to a consumer, and also a binary column that shows whether they bought the product or not.
I want to calculate the conversion rate (# of People bought/# People in Group) after grouping the consumers based on the number of ads they have seen (e.g. Group 1: 0-9 ads, Group 2: 10-19 ads etc. all the way until say 300).
Is there a way to do this other than manually calculating by group (i.e doing 30 of the same calculation)? Perhaps with some sort of looping function?
I have created a relatively complex PowerApp where I ran into an issue related to extracting data from a Collection.
The collection is populated by a simple ClearCollect(cachedKPI, '[dbo].[KPI]').
The KPI table has two columns KPIId (unique values and primary key) and KPIName. The first is a int column and the other nvarchar(200).
When displaying the two columns in a Data Table in PowerApp I noticed that out of a total of 188 rows only 150 was displayed. If I took the dbo.KPI table as the source of the Data Table all 188 columns were displayed as expected.
I created a new PowerApp without any other context and ran into the same issue.
When I looked closer at the data I saw that row number 151 to 160 had the same KPIName but different KPIId which in itself this is not an issue.
The KPIName of these rows were 'Retention > 90% (no loss of key staff)'.
After having performed various tests I tried to alter the KPIName. I found that if I renamed the KPIName of row 151 to 'a' I could suddenly also see row 151 (but still not 152 to 160) in the collection Data Table, which let me to believe the error might be due to special characters.
After a lot of testing I found something interesting. If I removed/replaced the 'y' in 'Retention > 90% (no loss of key staff)' everything was working as expected!
So having renamed the 9 rows called 'Retention > 90% (no loss of key staff)' to 'Retention > 90% (no loss of kek staff)' my PowerApp was suddenly working again.
I am not sure what the actual problem is. Using 'y' in itself does not seem to provide a problem, so it must be some combination of characters.
Has anyone experienced something similar and might be able to provide a solution?
One of our customers has a z-programm to generate a simple report about specific kinds of orders. The reports show several values of calculated vbak-netwr entries. There are sums, subsums, and single entries in lists.
Those values are shown in the local currency of EUR. Now, they have to be displayed in US$ as well.
Here is a simplified example:
Old:
Value
1400
1200
...
New:
Value (EUR) | Value (US$)
1400.............| 1757
1200.............| 1506
...
I know, I can use CONVERT_TO_FOREIGN_CURRENCY to do display the new information.
However, I am concerned about how to convert all those values (single, sum, subsum, etc...). Call the function each time for each value and save it into an own variable? This seems to be rather slow and increases the reports complexity.
Are there other ways to convert and display many values at once?
If all original amounts are in the same currency and there is only 1 target currency, how about calling CONVERT_TO_FOREIGN_CURRENCY once with 1 EUR to get the exchange rate (ex: 1 EUR = 1.26 USD) and then simply multiplying your amounts by the exchange rate (x*1.26) without re-calling the Function Module ?