2
I have 2 columns, Space
& Rows
. I want to iterate over the Rows
columns and sum only the corresponding value of Space
into a certain cell within the same page.
The pseudo code for this would be like:
FOREACH (E2:E10 as N)
IF (N == 1) B14 += N;
IF (N == 2) C14 += N;
IF (N == 3) D14 += N;
Where N would be the value of the current row it's looking over.
As far as the solution goes, I think it's easier to attack it from the point of view of the the cell that is going to get the value. In this case, that would be B14
, C14
& D14
. So in this case the function would be in each cell as pertains to itself only.
Something along the lines of:
=SUMIF(G2:G10, EXACT(GETCURRENTITEM(), 1), F2:F10)
=SUMIF(G2:G10, EXACT(GETCURRENTITEM(), 2), F2:F10)
=SUMIF(G2:G10, EXACT(GETCURRENTITEM(), 3), F2:F10)
I've recreated the spreadsheet in Google Docs, and if you can provide an answer for Excel or Google Docs that'd be great.
As far as Microsoft Office, I've looked up, SUMIF(), VLOOKUP() but the combination of these items is starting to look more like line noise then functions. I just can't quite wrap my head around it.
1Can you post a sample file with manually mocked up results? It's a bit hard to picture what you want to achieve. Why does a Sumif() not suffice? – teylyn – 2013-09-23T04:05:24.453
It looks like you are trying to iterate with
sumif
, but there is no need for iteration with it. – Raystafarian – 2013-09-23T08:58:52.280Shit, I'm so sorry. I made a Google Doc but did not link to it. So there it is.
– Mark Tomlin – 2013-09-23T17:33:35.113