We have a bunch of raw data dumps with sales info and I am trying to build a breakdown so we can determine how much of each products monthly sales were organic versus email promotion versus rebates, etc.
So you can see the image above. The if statement goes like this: If BreakDown="units" then sumif to match product name and month and year to get the total units sold. The false part of the if statement gives the units as a percentage of the total. So it's the same sumif formula but then divided by the total in row 19.
This is the formula in cell H15 so June PPC:
=iferror(IF($L$1="Units",SUMIFS('Monthly Sales Raw Data'!$AE:$AE,'Monthly Sales Raw Data'!$A:$A,$B14,'Monthly Sales Raw Data'!$B:$B,H$4,'Monthly Sales Raw Data'!$E:$E,$H$1),SUMIFS('Monthly Sales Raw Data'!$AE:$AE,'Monthly Sales Raw Data'!$A:$A,$B14,'Monthly Sales Raw Data'!$B:$B,H$4,'Monthly Sales Raw Data'!$E:$E,$H$1)/H$19),0)
Here is what happens when you change it to Percentage in the breakdown:
Instead of returning 132/419 it just gives a 0. It does this for every cell.
I have broken the formula out from the if statement and it works in all of it's component parts. It also works perfectly in excel. For some reason Google Sheets is not liking this if statement. I even tried changing the Breakdown away from text into a number like if it equals 1 sum the units, otherwise do the percent. That didn't work either.
I am completely stumped here because to me all the logic checks out and like I said it works in component parts and in excel. Is this a Google Sheets limitation? Any way around this to get it to work?
Thank you in advance for your help!
So you can see the image above. The if statement goes like this: If BreakDown="units" then sumif to match product name and month and year to get the total units sold. The false part of the if statement gives the units as a percentage of the total. So it's the same sumif formula but then divided by the total in row 19.
This is the formula in cell H15 so June PPC:
=iferror(IF($L$1="Units",SUMIFS('Monthly Sales Raw Data'!$AE:$AE,'Monthly Sales Raw Data'!$A:$A,$B14,'Monthly Sales Raw Data'!$B:$B,H$4,'Monthly Sales Raw Data'!$E:$E,$H$1),SUMIFS('Monthly Sales Raw Data'!$AE:$AE,'Monthly Sales Raw Data'!$A:$A,$B14,'Monthly Sales Raw Data'!$B:$B,H$4,'Monthly Sales Raw Data'!$E:$E,$H$1)/H$19),0)
Here is what happens when you change it to Percentage in the breakdown:
Instead of returning 132/419 it just gives a 0. It does this for every cell.
I have broken the formula out from the if statement and it works in all of it's component parts. It also works perfectly in excel. For some reason Google Sheets is not liking this if statement. I even tried changing the Breakdown away from text into a number like if it equals 1 sum the units, otherwise do the percent. That didn't work either.
I am completely stumped here because to me all the logic checks out and like I said it works in component parts and in excel. Is this a Google Sheets limitation? Any way around this to get it to work?
Thank you in advance for your help!