Count only "specific words" visible cells in a filtered pivot table - excel

I want to count only visible cells in Column Q that say "ME". I tried =COUNTIF(Q1:Q469,"ME") but it gave me the total for ALL of the cells in the table including the unfiltered results. I just want to count how many "ME" that are in Feb. I also tried SUBTOTAL but wasn't able to make it work.
I'm working on an older version of excel.

Add a new column to your data set with the following formula:
=countif(Q1,"ME")
This column should return 1s and 0s based on the values in your Inspected by column.
Update the pivot table to include this new data source and hit refresh.
Drag the new column to the value section of your pivot table fields list and summarize by Sum.
Include a grand total row ("on for columns only") in Design. The grand total will give you a total count of "ME" and update accurately as you filter through data.

Related

Count unique value with 2 criteria from 2 row

Can you help me to solve this problem?
I have two row with different value each row like this:
I want to count how many city with name london but only count if the Name if different, so from the table above the result count is only 2 london.
You can use a pivot table as a step to help:
Select the data and set up the pivot table:
Change the design of the table to set:
a. Report layout to tabular form
b. Report layout to repeat all item labels
c. Subtotals - do not show them
then the pivot table should be like this:
Finally, you can use COUNTIF. In my example, I have put the city name in G2 and referencing it in the formula:
=COUNTIF(D:D,G2)
You first need to group both columns
=COUNTIF(UNIQUE(A2:B14),"london")
COUNTIF count cells based on one criteria

Excel: Count Unique Values with Critera

I am trying to write a formula that will count unique values (both text and numbers) in a range that also has blank fields with a set of criteria.
Criteria:
Shipment Type = Specific Transport Type
Status Column = "Unplanned"
Despatch Month = Specific Month
This is very easy to execute with a pivot table. However I want to be able to write a formula instead, as I don't like the idea of having to refresh a pivot table every time new data is added.
Here is the formula I have written for Unplanned Shipping by Cost for Truck 2018-03 in cell I15:
=SUMIFS($F:$F,$C:$C,I$14,$A:$A,$H15,$B:$B,"Unplanned")
The same logic doesn't really apply when writing a =COUNTIFS formula to measure unique consignments as the unique values with blanks fields adds a layer of complexity.
to count the number of record where D:D is not blank:
write in cell I7 =countIFS($D:$D,"<>"&"",$C:$C,I$6,$A:$A,$H7,$B:$B,"Unplanned")

Add Number of Empty Cells in a Column Limiting To Last Data Cell

Looking to add a cell function that counts the number of blank cells in a column, but only to the bottom row of data. Each row in my spreadsheet is a customer order and the sheet keeps track of order assembly progress, each task is grouped into a column and if the cell is blank it means it is yet to be finished.
Tasks include columns F-K, other rows will not be counted
Goal: Number of incomplete(Blank) tasks in a column will be shown as a number at the top of the sheet.
Problem: When using =COUNTBLANK (x3:x) The function counts all blank rows to the bottom of the sheet, Need to limit this to the bottom of the data. That number changes depending on how many orders are on the sheet so this number needs to be adaptive to the bottom of the data(Last order)
Link to copy of Sheet: Order Priority Sheet
Any Additional Information, misunderstandings, or questions please ask. I understand if my descriptions were not clear and would be more than happy to help you help me!
Try:
=COUNTBLANK($A$3:INDEX($A:$A,LOOKUP(2,1/(LEN($A:$A)>0),ROW($A:$A))))
adjust the column references for your desired column
This part of the formula:
LOOKUP(2,1/(LEN($A:$A)>0),ROW($A:$A))
returns the last row number in column A that appears blank.
However, if, for example, you wanted to count all of the blanks in the range F3:Kn where n is the last used row in column A, then try this modification:
=COUNTBLANK($F$3:INDEX($F:$K,LOOKUP(2,1/(LEN($A:$A)>0),ROW($A:$A)),6))
If you just want to count each column separately, again, using column A to determine the last relevant row, then, (for column F):
=COUNTBLANK(F$3:INDEX(F:F,LOOKUP(2,1/(LEN($A:$A)>0),ROW($A:$A))))
and fill right
Column A seems to be a column where the last populated cell defines the extents of the data. Dates are considered numbers so the row with the last populated date in column A would be,
=match(1e99, a:a)
To count the blanks in F3:<last cell>,
=countblank(f3:index(f:f, match(1e99, $a:$a)))

Calculate average based on different criteria in excel vba

I am new to excel vba. I have a huge set of data for which I have to calculate averages corresponding to each id. Upon search, I came to know that it can be easily done by using excel AverageIf. But I have to calculate average of numbers which are below Threshold for an id.
Below is the screenshot of sample data. For example, when I calculate the average of Price for id 1, I will only consider Price values which are below 70 for average calculation as 70 is Threshold and any value above 70 cannot be included in calculation and same goes for all other ids. I would appreciate any ideas in this regard.
AVERAGEIFS should do the job:
=AVERAGEIFS(B2:B15,A2:A15,1,B2:B15,"<="&C2)
I like the countifs but here is another way using a helper column to determine if to include in average calculation. Assumes data set up as above without repeating Threshold value against each id.
1) Convert your data to a table with Ctrl+T (with a cell in the range selected).
2) In top right cell under header Average put
=IF(B2<INDEX($C$2:$C$13,MATCH(A2,$A$2:$A$13,0)),1,"")
It will autofill down all the rows in that column.
Tailor the ranges to your actual ranges. These ranges match the image below.
3) Select a cell in the table and press Alt + N + V to generate a pivottable and place it by the side of the current table with a 2 column gap.
4) Add id to the rows and price to the Values field. The add Average to the page field and filter on 1. Then right click on price in the Values area and select Summarize value field by Average.
5) You can add more rows to the table and the formula will autocomplete so you only need to refresh the pivot to get new averages.
Note:
You could also have used a lookup table to retrieve the thresholds.

calculated field in Excel Pivot

I am pretty sure that what I want to do is not possible, but I thought I'd give the experts a try.
I have a pivot table with countries in rows, date in columns and kgs, acreage and yield in rows. I am trying to make an estimation using calculated fields. What I want is (current)acreage*(previous date)yield.
Kind of a modified "Show As" calculation. Any ideas?
Thanks in advance.
Assuming that columns A-D are Date; Kgs; Acreage and Yield respectively and row 1 contains the labels, why not use a formula in column E.
As row 2 contains the first valid data, you would have to start at row 3. Therefore, cell E3 should contain the formula =C3*D2 which should be copied down to the last row of the pivot table.

Resources