Sum a column based on matching a cell reference in another? - excel

The yellow cells both have the formula =A2. I want a formula I can put into the red cells, which sums the blue cells if the cell reference in the yellow cells matches that of the row's green cell.
Since column A is non-unique, I need it to operate based on cell references, instead of string matching.
For example, C2 has the value 3 because A2 is referenced twice in the yellow cells, and the corresponding blue cells sum of up to 3 (= F2+F3=2+1). And C4 has the value 0 because A4 isn't referenced once inside the yellow cells, despite having the same string match.

You can try array formula:
=SUM($F$2:$F$10*IFERROR(ADDRESS(ROW(A2),1,4)=SUBSTITUTE(FORMULATEXT($E$2:$E$10),"=",""),0))

Related

How to count cells with a specific cell format containing zero?

How to count only cells containing zero with a specific cell format?
Take this list: A1 through A10 all contains zero. Cells A1, A4 and A5 of this range have a cell format which shows zeros as stars()*. Now, I'd like to count these three cells, stars.
You should be able to use =COUNTIF(A1:A10,0) if the value of the cell is 0. It does not matter the formating, if not try =COUNTIF(A1:A10,"*")

Excel - Formula To Find Match On List of Keywords?

If I have colors going from cells B1-B6 (Red, Orange, Yellow, Green,Blue,Purple)
And then a sentence/string in cell A1 - (There was a orange box).
I want a formula in cell C1 where if there is a match on any of the keywords, that is should spit out the keyword it matched. Attached is a screenshot example.
I would also want this formula in C1 to be able to drag down and have it "auto-fill". So that if I put any sentence in cell A2, it should repeat the formula in C1, but for this new cell of A2 automatically.
Use the formula:
=XLOOKUP(1,--ISNUMBER(SEARCH(B1:B6,A1)),B1:B6,"no match",2) in the "C" Column.
it will work!

Conditional formatting, color as many cells as the number above

i need to color as many cells as the number in the cell above. For example in the cell A1 i have the number 4 and i need to color 4 cells below that A2, A3, A4 and A5.
Assuming row 1 has the number of cells to color, in cell A2, create a conditional format with the formula =A$1>=ROW()-1. Copy this format to the entire table.

If cell equals 0 then change that value to the one from adjacent cell

I have a workbook with a single sheet that contains a table with 3 columns(years) and as many rows as there are months in a year.
Each cell under those headers has an integer number, usually between 0-10.
I'm trying to use a function that checks whether the cell this function is assigned to is equal to 0. If so, replace that 0 with a value from adjacent cell.
Formula: =IF(C11=0,C10,"")
For example, if there are two cells we're interested in C10 and C11.
C10 = 6
C11 = 0
If cell C11 has this formula, then it should replace 0 with 6.
Right now it doesn't change anything. Value in C11 remains 0. Why is that?
Duplicate the entire range alongside and then use formula in that copy table.
You cannot reference the cell you are entering formula into within it's own calculation. Your formula is fine otherwise.

Excel : How Can I Get First Cell Content

How Can I Get First Cell Content ?
here is my sheet
A
1 Color
2 Red
3 Blue
4 Yellow
note : Color has filter
i want to make the cell B1 = first cell of column A - I try type in B1 =A2
but when i make filter (example i select blue) the cell B2 show nothing (i want B1 to show the filtered data on first column )
A Non-Volatile AND Non-Array entered option is to use a helper column:
In B2 Enter =SUBTOTAL(3,A2) and drag it down. This will mark every row with a 0 or a 1 depending on if it is visible or not.
Then in B1 you can simply enter:
=INDEX(A2:A4,MATCH(1,B2:B4,0))
The above will search the B column for the first 1 (stands for visible), and return the value of the cell in column A of that row.
In B1 enter the array formula:
=INDEX(A2:A100,MATCH(1,SUBTOTAL(3,OFFSET(A2:A100,ROW(A2:A100)-ROW($A$2),,1)),0))
Array formula must be entered with CNTRL-SHFT-ENTER rather than just the ENTER key

Resources