Count if a cell is not blank, and matches an adjacent cell - excel

Example table
Column 1
Column 2
First
First
Second
Second
Third
Third
Fourth
Fifth
Fifth
Sixth
So, what I am trying to do is Count all the cells in column 1 that are NOT blank AND match the adjacent cell in Column 2.
In this case, the total count should be 4. How would this formula be written?

=SUMPRODUCT((A2:A7=B2:B7)*(A2:A7<>"")

Related

Get row index of most recent non-blank cell in adjacent column (Excel)

In an Excel spreadsheet I have Column A with some text spaced out by blank cells. I want in Column B to return the row index of the nearest non-blank cell in Column A (from above only).
Put this in B1 and fill down.
=match("zzz", a$1:a1)
You could use the following on the second row after manually putting the row number for the first row:
=IF(A2="",B1,ROW(B2))

Excel formula to combine info on different columns

I need to make a spreadsheet with 4 columns and on the 1st column I need a formula to enter and combine the text of the other columns. The spreadsheet will be as follows:
In the 3rd column will contain first names and the 4th column will contain last names. The 2nd column will contain other names. If there are names in the 3rd and 4th columns the 2nd column will always be blank and if there is text in the 2nd column the 3rd and 4th will always be blank.
In the first column I need a formula that will enter and combine the information for the 2nd, 3rd and 4th column.
I think we can just use something like this. Enter the following into A2, assuming your data begins in the second row, and that columns A through D inclusive are the first through fourth columns:
=IF(B2="", C2&" "&D2, B2)
This simple formula says to take the first and last name concatenated together should column B be empty. Otherwise, it takes column B.

Dynamic SUM or SUMIF Formula

I want to get the SUM of the first column IF the next column has data. In this example, the second column has data for the first 6 rows, therefore the sum that I want to get is the sum of the first 6 numbers in column 1. How the second column gets its data is chronological, so there will be no skipped cells.
You could use this formula:
=SUMIFS(A:A,B:B,">0")
It will sum the numbers in the first column, if the corresponding letters in the second column are greater than zero. Let me know if this does not cover all of your criteria, I'm sure I can help.
Thanks.

Count non blank rows in a certain range/column Excel

I want to count empty (or non-blank) rows in a given column (or range).
Example: I have a column which is spaning over 4 cells width, and each cell has either a single ''x'' or is empty. There is up to 100 rows under this column. Here's a picture to clarify:
The COUNTA() function will do that for you. For example:
=COUNTA(A1:A100)
Will return the number of non-blank cells in the range A1:A100
You can use array formula. For example, to count the first 10 rows starting from row 2.
=SUM((COUNTBLANK(OFFSET(B2,ROW(1:10)-1,0,1,4))=4)*1)
To count the first 100 rows:
=SUM((COUNTBLANK(OFFSET(B2,ROW(1:100)-1,0,1,4))=4)*1)
Use a new column to get the number of blank cells in each row, then count the number of row in this column which are equal to 4.
Or, more simply, write =QUOTIENT(COUNTBLANK(B2:E2);4) in F2, pull the cell down, then write =SUM(F2:F101) in G2.
If there is exactly 4 blank cell in a row, the F cell will have a value of 1 and the sum will just add all of these 1 to get the number of empty rows.

Substract last cell in row from first cell with number

I have the following Excel sheet
In column J i need the final difference between the first cell in the row and the last cell (with a number).
Numbers can appear from column C until column I. Numbers do not always start in column C and do not always end in column I, but there are never empty cells in between.
Basically i need to subtract the value in the first cell with a number from the last cell with a number. The last value in the range from C-I minus the first value in that range with the result being displayed in J.
I filled in column J manually for now, however I would like to do it with formula.
If the numbers are always ordered from smallest to largest, you could simply do this:
=MAX(C2:I2)-MIN(C2:I2)
If not, things become a bit more difficult. Here's another solution that should work for non-ordered entries:
First, add an empty column to the right of Totaal.
Second, add seven columns with the following contents:
=IF(ISBLANK(C2),M2,C2)
=IF(ISBLANK(D2),N2,D2)
...
Third, add another empty column.
Fourth, add seven columns with the following contents:
=IF(ISBLANK(C2),S2,C2)
=IF(ISBLANK(D2),T2,D2)
...
Totaal can then be calculated with
=Z2-L2

Resources