get the average of two columns in views using lotus notes formula - lotus-notes

How to get the average of two columns in views using lotus notes formula

Create a new column in your view to display the average. You'll add a formula to this column to calculate the average.
If the two columns you wish to average are simply based on items in your documents, then add this formula:
(Column1 + Column2) / 2
If your columns are more complex, for example they contain calculations themselves, then you'll want to refer to the column using its programmatic value. On each column, right-click on the column and then click "Column Properties". Select the last tab and set the Programmatic name to some text, for instance Calc1 and Calc2. Then use this formula in your third column:
(Calc1 + Calc2) / 2

If you want to display the average of 2 columns then Bluefoot's comment referring to another question is what you require. However, if you also want to display the result in a subsequent third column, then you have a bit more of a problem.
You will need to write a scheduled agent that takes the average but then writes the result into a field on to the document, and then use that field as the value to be displayed in the 3rd column. I say a scheduled agent as you could have this run hourly or daily as required to update values. If a user changes the values that would cause a re-calc. You can clear the new field pending update of by the scheduled agent. There are still other ways to do this, depends on requirements.

Related

Counting the frequency of unique entries in an excel column

I run a customer service department (I'm new to this so need to learn quickly) and I'm trying to get some analytics on our customer service requests. I have a table in excel documenting every individual service request and I would like a graph showing the total number of requests per customer.
I could write this manually (see below) but I would like it to automatically update as more service requests are entered.
I have tried looking for answers to this but can't find any that update automatically or that don't require a table elsewhere to be manually updated with each new customer. We often get new customers and I dont want to have to go back to this every time to update a reference table or customer list.
Surely there must be a way in excel to "Count all entries of each occurrence of a name in a column" in some kind of smart way?
I would really appreciate help with this!
Thanks in advance!
If you have 365 you could take advantage of spilled ranges.
On your second image put =UNIQUE(Table1[Customer]) in cell B3.
Put =COUNTIF(Table1[Customer],B3#) in cell C3 - this formula will
spill to all your unique customers.
Create two names ranges:
One called XAxis which references =Sheet1!$B$3#
One called ChartValues which references =Sheet1!$C$3#
Create your chart:
Set series value to =Sheet1!ChartValues
Set axis to =Sheet1!XAxis
Change Sheet1 to whatever your sheet is called remembering to wrap with ' if it has a space in the name.
Better to use pivot tables.
If below is your data,
Go to Insert > PivotTable
A popup will show like below
Specify the Table/Range
Specify also the Location (anywhere in the Existing Worksheet)
The view below will be displayed
Click the Customer checkbox and also drag the Customer field to fill the VALUES box as shown in the image below
You desired table will be displayed as below
Please vote up if okay.
Thank you everyone for your suggestions. I found a solution from multiple answers and comments.
I ended up going to my original table that I am using to create new service records. I added a column called "1" and just entered the number 1 in that column, for every row. I then "Hid" this column in the usual fashion.
I then created a pivot table from this table and selected to display columns "Customer" and "1" and used these columns to produce a bar graph. Here is the result (With the column "1" unhidden):
tl;dr:
Excel is unable to do this in any smart way, create a column in the original table contianing the number 1 so when a pivot table is made, it will auto sum the 1's for entries from the same customer. Create a plot from this.
It disgusts me . . . but it works.

I want to create a costing table for when various options are selected in Excel

I have created a table for the price of the different option combinations but want to show the total cost on a simple input table.
So I want to select from 3 different option groups in separate columns (venue, time period & support). I have drop down lists for each of choices within these options and the prices associated with each. I want to show the cost if I choose venue option 1 in column C, time period option 2 in Column D and support Option 3 in Column E. I have tried the formula =if(and(C3=I2,D3=K1,E3=J3),K3) which works to give me one cost with one range of selections but how do I add more selections to the Formula. (I moved the 'look up' table onto the same tab so it was easier to read which is why the formula is showing the sheet ref.)
I would look at using index & match with two data validation lists like this:
Here is the formula used in cell F8 so you can copy it:
=INDEX($L$2:$M$4,MATCH(F2,$K$2:$K$4,0),MATCH(G2,$L$1:$M$1,0))
I would consider re-jigging the data so that a third data validation controls which data set is relevant. The choose function can work for that as well.
F2 and G2 are data validation selecting service level and time.
Edit: Version with choose to select data:
Added a vlookup to give an indexing number for the choose function and the choose to get the data from the list based on which is selected.

Calculate average of values in a column based on matches of two variables in two other columns

I'm having an issue with some data that I'm working on that has had me stuck for a while.
I'm working on some patient data for a clinical practice that has each patient encounter logged on a separate line with an account ID, date of service, the height and weight measurements for that date, and other variables.
Aside from VLOOKUP and the usual formulae/functions I've got a pretty rudimentary understanding of Excel but I can pick up on things fairly quickly.
In the data I've got each line tied to a patient account ID as well as what quarter the DOS was in. For patients with multiple visits, they will be identifiable by repetitions of the account ID number on other lines.
For some patients, there will also be repetitions in the quarter if the same patient was seen twice in the same quarter. This is where I need help.
I'd simply like to average the value of a variable for each patient in each quarter. I'm not sure if AVERAGEIFS is the right function to use but I need an operation that checks for matches in a line of both account ID and quarter (Q1, Q2, Q3, or Q4) with the other lines in the sheet and comes up with a quarterly average for the variables in question.
What I have
What I need
If I'm understanding your question, you could use AVERAGEIFS to accomplish what you are asking. With excel, a lot of how successful an approach will be is determined by how your data is structured, and if/how often you are planning on updating your work.
It would be easier to give a concrete answer with an example of the data you are looking at.
If your source data is in columns A:D something like:
and you are looking to summarize the weight data in I by account ID and Quarter:
you could use AVERAGEIFS(C:C,A:A,G2,B:B,H2) this would find the cells in column A that match the value in G2, find the cells in column B that match the value in H2, and report the mean value in column C of the matching rows.
An alternative is to use a pivot table, which automates a lot of what you are trying to do. For that approach you would select your data block, and click on Insert>>Insert Pivot Table (at least in my version). That should bring up a wizard. Accepting the defaults will create a new sheet. Then look on the right side of your window, and you should see a list of your column names near the top, and four boxes called Filters, Columns, Rows, and Values. You should be able to drag and drop your columns into these boxes to get summaries of your data. If you add your Account ID and Quarter tabs as columns, and your height and weight as Values, then right click on each of the value columns and select "Value Field Settings" and select Average from the menu that pops up. That should give you something that looks like:
At that point, you can change the formatting to make if fit your needs, or copy data somewhere else.
The AVERAGEIFS approach will automatically update if you add more data, but will only summarize things that match the values you list. If there is an account ID/Quarter pair that isn't in the summary column you won't have any idea it's there. If you are summarizing an ID/Quarter pair that isn't in your data you'll end up with a division by Zero error like in the example.
The Pivot Table option only updates when you manually click refresh (right click and choose refresh pivot table from the menu), but will summarize all the data based on the columns you've selected. It's also a little more robust as you avoid having to type out the formulas and make sure you are pointing to the right column. This option also by default provides nested summaries; you can turn the subtotals and grand totals off if you want.
I used the function:
=SUMPRODUCT(($B$2:$B$13="Customer 1")*($C$2:$C$13="Q1"))
Where Customer 1 could be a user id and Q1 you can change to which quarter you want.
Excel screenshot

how to calculate the means of 100s of subgroups in excel

I have a spreadsheet with ~8000 records, there are ~400 unique identifiers (i.e. element 101, 102, 103....500) that I need to calculated means for. Is there a simple way to calculate means on large datasets like this?? Or will I have to do =average('select column block') for each subgroup/unique identifier?
Many Thanks
Use the following formula
=AVERAGEIF($A$1:$A$8000,"=IDNUMBER",$B$1:$B$8000)
Where
Column A is your column of ID numbers
Column B is your list that you need the mean from.
If your ID numbers are sequential, you can set up something like:
=AVERAGEIF($A$1:$A$8000,"="&100+row(A1),$B$1:B8000)
And copy that down from say C1 to C500
Alternatively you could make a list of the unique identifiers with another formula and place that unique list in C1 to C500 and then in column D use the following:
=AVERAGEIF($A$1:$A$8000,C1,$B$1:$B$8000)
If you have a header row you will need to adjust your ranges accordingly
The formula to generate a unique list of IDs is:
=INDEX($A$2:$A$8001,MATCH(0,INDEX(COUNTIF($C$1:C1,$A$2:$A$8001),0,0),0))
Use that in column C but in row 2 and copy down. So if your data starts in row 1 you will want to bump it down 1 row.
Create a pivot table with the unique identifiers in the rows and calculate the average of the values.
For data that is clustered up nicely and immediately ready to be handed off for a visual review of the averages try a creating a Subtotal:
Select your data
Go to Data > subtotal (far right on the tab)
On the menu popup in the At each change in field, select the column header name that corresponds to your unique identifier.
Select Average for Use function. Select the checkbox of the column for which you want to find the group's mean.
Select other formatting features if desired (defaults typically work best)
Click okay.
Take a sip of coffee and let the magic happen.

How to use Cognos report studio creating a list with dynamic columns?

I need to create a table list in cognos, but the columns of this table would change depend on the data.I don't know how to do this. I just know in cognos report studio, we can drag data into cognos list report.
Update:
I don't know how many columns in this table.Because different data generate different number of columns.Actually,one row of data is a tree hierarchy.For example,the first columns is root,the second column is its child,and maybe the third columns is second child,or first grandson,and so on.So the columns always change.
In report studio just make list report by dragging on your wish.
But make sure it contains all columns that you need (i mean columns inculded in dynamic changes).
Say 4 columns you need at max.
Name
Roll no
Age
Address
Then create conditional style vairable (You can find in center bar)
now based on this condition dynamically chose the style.
Eg: If condition 1 satisfied
Name
Roll No
If condition 2 satisfied
Name
Address
I would use a Crosstab instead of a List. The columns are created dynamically without any other programming involved.
Just drag a Crosstab into report page, set the columns and rows (which can be nested by the way) and finally, drag the fact field right at the center of the Crosstab.
Try the following:
Create a list as per the requirement.
Hide the columns.
In each column expression, give the condition and set show as per the condition.

Resources