Hello!
Bit of an odd question - I have a formula that works, but I want to know HOW it works?
It's someone else's spreadsheet, so I'll suggest better methods to them next month, but for now:
This formula is in a sheet that's totalling order details pulled together from other tables.
=SUMIF(H:H,"*"&Licence_Totals[@[License (Auto-Populated from Table 3)]]&"*",Data!F:F)
Column H contains item names that are not unique, and column F contains the number of those items ordered.
The formula is checking a list of unique item names (or categories, I suppose), finding all instances of each string in column H and totaling the number of each item ordered.
So first list might be:
Bananas - 1
Apples - 2
Green Bananas - 2
Apples - 1
Bananas - 3
And it will return:
Bananas - 6
Strawberries - 0
Apples - 3
Where Bananas, Strawberries, Apples is a fixed list (the zero orders are also important).
Why I'm confused:
As far as I can tell, it should be comparing strings in column H with strings in the Licence column of the Licence_Totals table.
However, if I move the Licence_Totals table down by inserting rows above it, the formula goes out of whack by the same number of rows (so it returns first total to cell L6, instead of L4):
Bananas - 0
Strawberries - 0
Apples - 6
Blank
Blank - 3
I can fix it by moving the destination table down an equivalent number of rows.
That makes me think that instead of checking WHAT it is (the string) it's pulling the data based on WHERE it is, and I can't see why? What don't I understand?
Thanks!
Bit of an odd question - I have a formula that works, but I want to know HOW it works?
It's someone else's spreadsheet, so I'll suggest better methods to them next month, but for now:
This formula is in a sheet that's totalling order details pulled together from other tables.
=SUMIF(H:H,"*"&Licence_Totals[@[License (Auto-Populated from Table 3)]]&"*",Data!F:F)
Column H contains item names that are not unique, and column F contains the number of those items ordered.
The formula is checking a list of unique item names (or categories, I suppose), finding all instances of each string in column H and totaling the number of each item ordered.
So first list might be:
Bananas - 1
Apples - 2
Green Bananas - 2
Apples - 1
Bananas - 3
And it will return:
Bananas - 6
Strawberries - 0
Apples - 3
Where Bananas, Strawberries, Apples is a fixed list (the zero orders are also important).
Why I'm confused:
As far as I can tell, it should be comparing strings in column H with strings in the Licence column of the Licence_Totals table.
However, if I move the Licence_Totals table down by inserting rows above it, the formula goes out of whack by the same number of rows (so it returns first total to cell L6, instead of L4):
Bananas - 0
Strawberries - 0
Apples - 6
Blank
Blank - 3
I can fix it by moving the destination table down an equivalent number of rows.
That makes me think that instead of checking WHAT it is (the string) it's pulling the data based on WHERE it is, and I can't see why? What don't I understand?
Thanks!