SUMIF using named array consisting of non-adjacent columns - excel

Good morning!
I am trying to create a dynamic SUMIF by using a named array containing data in non-adjancent columns.
The situation is as follows:
I have a file with monthly data, where the columns are labelled as:
Jan 2010, Feb 2010, (...), Dec 2010, FY 2010 (...) Jan 2020, Feb 2020, (...), Dec 2020, FY 2020
I want to sum only the monthly data (Jan 2010, Feb 2010... Dec 2010, Jan 2011, Feb 2011, etc) and exclude the data in the FY column (FY 2010, FY 2011, etc etc)
I have named the array of monthly data that interests me as a range ("relevant_monthly_data")
I am looking at individual rows of data that interest me ("country_range"). Note that the country_range consists of only one column with all the countries. It has the same number of rows as "relevant_monthly_data".
The formula that I am using only works for the first set of adjacent columns (Jan-Dec 2010), but doesn't capture Jan-Dec 2011, 2012... all the way through to 2020 even though they are all part of the named array).
=SUM(INDEX(relevant_monthly_data,MATCH("Guatemala",country_range,0),))
Could you please help me?
I am sure it is a simple question, but I somehow cannot figure out how to sum this range beyond 2010 monthly entries...
Thank you in advance for your help!

Related

AVERAGEIFS Excel Formula Incorporated With Dates

so I have an excel file with 2 tabs. 1 tab lists some values for Aug - Dec 2019 is separate columns while the other tab is the average of every 3 months (ie: Aug - Oct 2019, Sept - Nov 2019, Oct - Dec 2019).
I am trying to create a formula to give me the average of 3 months (listed in tab 1) if the KRI_ID column (in column A) is the same.
Note: Dates are input in custom format (mmm-yy)
You dont need an Averageif formula, since the KRI_ID is unique to each row. You can simply enter the following formula in cell J2 and drag across then drag down from J2 for the rest of the rows:
=Average(J2:L2)

Excel Running Total if data in current month

I am trying to write a formula in Excel that will compare 2015 totals to 2016 totals and projections. If there is a value in the rows for January, February, March and April, I want the 2015 sum of those same months. Then the same for the projected
Screen capture of excel file
I like to use SUMPRODUCT() for something like this:
Projected:
=SUMPRODUCT(($B$5:$B$16<>"")*$A$5:$A$16)
Actual:
=SUMPRODUCT(($B$5:$B$16<>"")*$D$5:$D$16)

countif adding up how many are in a certain month

I am trying to get a formula that counts up how many cells contain this month and how many cell contain < than current month eg: in a column
March 2015
January 2016
April 2016
May 2016
May 2016
May 2016
June 2016
And then have a cell at the bottom that tells me 3 for May and 3 out of date
Assuming your data were in column A and you had 15 points, then the following two formulae should work.
Number of cells in the current month:
=COUNTIF(A1:A15, "5/1/2016")
Number of cells before the current month:
=COUNTIF(A1:A15,"<5/1/2016")

Excel List - Dynamic

I have a list in Excel that allows me to drag-and-drop the following:
Y2014 Jan
Y2014 Feb
Y2014 Mar
Y2014 Apr
Y2014 May
Y2014 Jun
Y2014 Jul
Y2014 Aug
Y2014 Oct
Y2014 Nov
Y2014 Dec
I want the list to continue to Y2015 Jan and way beyond, but a list can only contain 255 characters. Is there a way to make this list continue? I want to be able to drag this list indefinitely, so that the year adjusts appropriately. Is this possible?
If you refer to a custom list, then you may want to consider a different approach.
Instead of a list, use real dates. In the first cell enter Jan-1-2014, next cell Feb-1-2014. Enter the dates according to your regional settings, so Excel recognizes them as dates, not as text. Then format with custom format
\Yyyyy mmm
Now drag down as far as you want. Excel recognizes that you want to increment by one month and the formatting shows the desired characters.
Alternative: You can have the real date in a helper column and drag down as described above. Leave the standard date format. In the column that is used by the macro, you can put a formula like this (if your date helper column is column Z, data starts in row 2):
=TEXT(z2,"\Yyyyy mmm")
The result of this formula is text. Drag down as far as required.

Convert date column

I have data in an excel sheet. There I have a column with date values like this.
13 May 2012
27 August 2012
21 June 2012
18 March 2012
16 November 2011
15 December 2011
Is there a way to convert it to a format like this? 1998-12-25
I am assuming your dates are stored as strings. If one of your data is in cell A1, use in B1
=DATEVALUE(LEFT(A1,FIND(" ",A1)-1)&" "&LEFT(MID(A1,FIND(" ",A1)+1,FIND(" ",RIGHT(A1,LEN(A1)-FIND(" ",A1)))-1),3)&" "&RIGHT(A1,4))
Then format B1 as Custom, Type: yyyy-mm-dd.
Shorter formulas are possible, in particular if you can assume that the day will always have two digits (e.g., 01, and never 1).
If your data are stored as numeric instead of string, then simply apply the formatting procedure described.

Resources