Sharepoint - How to sum of a calculated column - sharepoint

I'd like to sum my "Estimation" calculated column, how can I do this?

I recommend you to use the number column, which has a built-in sum function. Other types of columns do not have this function.
1.For the classic list, you could use code to make the "Calculated" column to show the totals.
Reference:
https://sharepoint.stackexchange.com/questions/151697/display-sum-of-a-calculated-column
2.For the modern list, you could use flow.
Reference:
https://learn.microsoft.com/en-us/answers/questions/89029/total-of-a-calculated-column-on-sharepoint-365-and.html

Related

Random cell with index & match with extra criteria in another column

I got three columns: Level, Calculation and Answer.
To choose a random calculation, I use the formula: =INDEX(B2:B16, RANDBETWEEN(1, COUNTA(B2:B16)))
To get the related answer, I use the formula: =INDEX($C$2:$C$16,MATCH(F2,$B$2:$B$16,0))
Now I want to choose a random calculation based on the level in the first column. So instead of choosing a random calculation from the 15 calculations in column B, I want it to choose a random calculation from column B where column A for example is '2'.
Is this possible and if yes, how?
Example of my spreadsheet
use:
=QUERY({FILTER(A2:C, A2:A<>""), RANDARRAY(COUNTA(A2:A))},
"select Col2,Col3 where Col1 = 2 order by Col4 limit 1")
Assuming you put your chosen level in G1:
=LET(ζ,FILTER(B2:B16,A2:A16=G1),INDEX(ζ,RANDBETWEEN(1,ROWS(ζ))))
You could make a unique list of the levels and put that in a range to provide user entry for the level selector, then use the level to filter the table. It seems to work but you might want to test it.
image of possible solution

VLOOKUP text with two criteria

I'm looking for a way to insert a column based on two criteria, as illustrated below. I have a main table with one row per company, and I want to add a column to this with the city names. However, the lookup table has two rows for some companies - one for "small" and one for "large". I'm only interested in retrieving the cities for companies that have size value "small".
I know that I can achieve this with =SUMIFS if the content of the column was a number instead of text. However, with the cities column consisting of text, I don't know how to proceed. I'd ideally like a solution where I don't have to use a helper column.
Edit: this is just an example of my data. I have hundreds of rows,the duplicate answer suggested uses INDEX/MATCH which requires me to give the exact cell location of each condition. This is not the case in my data.
There are a few solutions that I usually use for these tasks. They're not elegant i.e. not a 2-criteria look-up per se, but they get the job done.
Going by your data structure, you have these choices:
Sort your lookup table by size-company, with size in descending order. Thereafter, it's a straightforward vlookup since your big companies are seggregated from small ones.
Build a new key consisting of company-size i.e. CONCAT(company,size) and do the vlookup based on this key.
It's not possible with VLOOKUP. Look my solution in the picture using a array formula.
Solution using array formulas
Formula in F2: =INDEX($C$1:$C$6;SUM(IF(E2=$A$2:$A$6;1)*IF($B$2:$B$6="small";1)*ROW($C$2:$C$6));1)
Ps: don't forget to confirm the formula with Ctrl+Shift+Enter.
Multi-column lookups are certianly possible but not using VLOOKUP. You'll need to use INDEX and MATCH. This becomes pretty complex as it combines array formulas with boolean logic. Here's a nice explanation.
https://exceljet.net/formula/index-and-match-with-multiple-criteria
For your example, assuming Desired Result Company is in column I.
=INDEX($F$4:$F$5,MATCH(1,(D4:D5=I4)*(E4:E5="small"),0))

Sum of products for each row

Given a table with two columns, A and B:
For each row, multiply A and B, then sum all the results.
I can just do =(A1*B1)+(A2*B2)+... but I need it to work for a table of any size.
that is exactly what SUMPRODUCT is for:
=SUMPRODUCT(A1:A5,B1:B5)
You can also use the array version of sum. This can give some added flexability in certain situations.
{=SUM(A1:A5*B1:B5)}

count unique values between defined range in column

I've got column which consist numbers of type 000.XX.XX
=COUNTIFS(temporary!$A1:$A200,">=000.11.35",temporary!$A1:$A200,"<=000.11.39")
this formula counts values between 000.11.35 and 000.11.39. But i want to count only unique values. How can I do this?
There is not a built-in function for this, as you can see from the several suggestions of how to accomplish this on the Office support site. If you can, you can switch to Google Sheets, and they have a "COUNTUNIQUE()" function.
As described at the link provided above, identify the unique items, either using a filer (this is static) or through repeatedly using the "FREQUENCY()" function. Then count the unique items in a separate step.
Lets say you have the data set in the first column, first you need to remove the repetitions in a second column with the following array formula (confirm the formula with Ctrl+Shift+Enter)
=IF(SUM((A2=$A$2:A2)*1)>1,"",A2)
this formula lists only unique values
I would remove your first 4 digits of your string to create a float number and then count it with the following array formula:
=SUM((IF((RIGHT($B$2:$B$14,4)>=RIGHT(G3,4))*(RIGHT($B$2:$B$14,4)<=RIGHT(G4,4)),$B$2:$B$14,"")<>"")*1)
Please look at the two images for clarification
view with formulas
normal printscreen

How do I sum only positive numbers from another column that must match certain criteria in my first column?

I have about 500 item #s in Column A that represent all of the different items we put in or out of production during the week.
In Column F I have the total lbs of that item with positive or negative numbers reflecting in to production and out of production respectively.
I already have the following formula setup to tell me what the total loss/gain is:
=SUMPRODUCT(--(ISNUMBER(SEARCH({"0883","0884","0885"},A6:A280)))*F6:F280)
I would like to then sum only the positive numbers so that I can get a shrink/gain percentage based on the product we put into the room. This is where I am stuck.
I believe you are looking for the SUMIF() function of Excel.
Here's a link to Office.com
You can add another condition as follows:
=SUMPRODUCT(--(ISNUMBER(SEARCH({"0883","0884","0885"},A6:A280))) * F6:F280 * (F6:F280>0))
You can just extend your formula with another condition like this
=SUMPRODUCT(ISNUMBER(SEARCH({"0883","0884","0885"},A6:A280))*(F6:F280>0),F6:F280)
What sort of values are in A6:A280? Which version of Excel are you using? - if 0883 etc. will be the full cell contents then you don't really need SEARCH and you might be able to use SUMIFS which will be more efficient, i.e. this version given your comments
=SUM(SUMIFS(F6:F280,A6:A280,{"0883","0884","0885"},F6:F280,">0"))

Resources