0
votes

I'm trying to build a function that has the following logic within cell E13 on a Google spreadsheet.

  1. If current month equals January, perform the following operation in the column G labeled January: G4-G5-G6;

  2. If current month equals February, perform the following operation in the column H labeled February: H4-H5-H6;

...and do this for all months (Column B is August/Column M is July).

Currently cell D11 returns the text value of the current month by using the vlookup function for a 2 column table (H11:I20) where column H is a list of integers from 1 to 12 and column I is the text value associated with each int (ie January = 1, etc).

Cell I10 returns the integer value of the current month using the MONTH(TODAY()) function.

VLOOKUP then compares the index value to the columns and returns the text value that is adjacent to the matching month number.

Basically in plain English, I only want to see the cash flow for the current month because I am tracking expenses using a monthly ledger.

1

1 Answers

0
votes

Not a good solution but perhaps better than nothing until something better comes along:

=offset(A4;0;vlookup(D11;I11:J20;2;false))+offset(A4;1;vlookup(D11;I11:J20;2,false))+offset(A4;2;vlookup(D11;I11:J20;2,false))

This assumes 6 in J11 (immediately to the right of January), 7 below that and so on.