Match multiple criteria, including date within a set month, and returning the date when matched

thelittleredfox

New Member
Joined
Dec 15, 2014
Messages
17
Hi, I'm really struggling with this so I hope someone can help me!

My spreadsheet shows all commission payments on individual insurance policies, each of which has a unique number. There is one payment per policy per month.

My excel spreadsheet has two sheets. One sheet, "raw data" contains data copied and pasted from regular reports so I can't insert extra columns for formulae on that sheet. Each line in this sheet represents a payment on a policy, and they appear in date order - there are therefore multiple lines in the sheet for each policy, but only one line per policy within any given month.

On the "raw data" sheet:
column g is individual policy numbers
column a is the date of the payment, given as the day in the month
column m is monthly commission.


Summary sheet
I then have a summary sheet, which is supposed to show, for each month, if a payment has been made on each policy and if so which date it was made on, and how much for. This is the sheet into which I want to insert my formulae.

On my summary sheet:

column a is a list of all policy numbers - each appears only once, one line per policy number
column b,c,d etc. are headed by the months of the year going across the sheet. In the cell above the name of the month, I have put the month number, e.g. 8 for August.

If possible, for each month I want 2 columns. For example for August:


  • the first column would be the date commission was paid in that month. If no commission payment appears in the "raw data" sheet, this should be blank.
  • the second column would be the amount of commission which was paid that month, if commission was paid. If not, cell should appear blank.

I use vlookup a lot but I don't normally use index and match, which I'm guessing is what I need to use here. I can't work out how to incorporate matching the dates within a month at all. Do I need the MONTH function?
Excel 2010.
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
As a temporary measure, I've inserted an extra column (column b) into the "raw data" sheet with the following formula:

=MONTH(A2)

to give me the month of the date in column a.

This has enabled me to put this formula into column b of my "summary" sheet:

{=IFERROR(INDEX('Raw data'!$A$4:$A$1500,MATCH(1,('Raw data'!$G$4:$G$1500=$A5)*('Raw data'!$B$4:$B$1500=$E$1),0)),"")}

This references E1 into which I've typed 8 (for the month of August, the first month on the sheet).

HOWEVER

How can I get the month in this formula matched WITHOUT needing the extra column in the "raw data" sheet? Is there a way to insert the MONTH function into the array formula???

Also, is it possible to do this by referencing the date in the heading of column b - formatted as a date Aug-14 - rather than by referencing the number 8 manually typed in E1?

Thanks!
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,102
Messages
6,170,122
Members
452,303
Latest member
c4cstore

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top