Multiple Criteria, Including Date Range

Savene

New Member
Joined
Apr 2, 2019
Messages
2
Hello MrExcel,

I'm stuck on an issue. I have a log of quoted parts and a log of sales on separate tabs. The quote log has a date range for each quote, and the sales log has a date of sale. Both have part numbers for each.

I'm trying to have my quote log match criteria and return whether or not the quoted job was "Won". I'd like to do a search of the part number, then verify if the sales date was within the quote date range, if so, place "Won" in the cell.

SHEET1
ABCD
1Part1233/1/193/5/19
2Part4563/2/193/7/19
3Part1233/6/193/11/19
4Part7893/4/193/9/19
5Part4563/8/193/13/19

<tbody>
</tbody>

SHEET2
ABC
1Part1233/10/19WON
2Part3333/1/19WON
3Part4563/9/19WON
4Part7893/8/19WON

<tbody>
</tbody>


This is the formula that I'm using to fill in the "Won" in SHEET1 in cells D:D

{=INDEX(Sheet2!$C$1:$C$4,MATCH(1,((Sheet2!$A$1:$A$4=G1004)*(Sales!$B$1:$B$4>=B1)*(Sheet2!$B$1:$B$4<=C1)),0))}

I've tried this a few different ways, but I'm still getting #N/A even though I've verified that several should say "Won".

Any insight or direction would be much appreciated.

Thank you!
 

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi Savene,

Maybe this;


Book1
ABCD
1TestWON
2
3Part12301-03-1905-03-19 
4Part45602-03-1907-03-19
5Part12306-03-1911-03-19WON
6Part78904-03-1909-03-19WON
7Part45608-03-1913-03-19WON
Sheet1
Cell Formulas
RangeFormula
D3=IF(COUNTIFS(Sheet2!$B$1:$B$4,">="&Sheet1!B3,Sheet2!$B$1:$B$4,"<="&Sheet1!C3,Sheet2!$A$1:$A$4,Sheet1!A3,Sheet2!$C$1:$C$4,Sheet1!$B$1)>0,$B$1,"")



Book1
ABC
1Part12310-03-19WON
2Part33301-03-19WON
3Part45609-03-19WON
4Part78908-03-19WON
Sheet2
 
Upvote 0
Hi there
I think this thread is the closest to what i look for but still i am not sure.

I need to apply the correct service rate based on sale date ranges.

For the same service i have multiple rates based on dates and i have multiple services

So below table represents the Price Catalogue which can be updated at any time and as many times as neccessary.
The rates are valid on the date and onwards.

The oldest Date entry equals first time service was introduced

So in words Service code A costs 4.5 from 15/01/2019 till 14/02/2019.



Service CodeRate Valid From (dd/mm/yy)Rate
A15/03/20195.25
A15/02/20194.75
A15/01/20194.5
B03/04/20199.5
B12/06/20188.5

<tbody>
</tbody>


So i want to set up a 2nd table keeping history of sales and applying the correct rate based on sale date through the price catalogue.
The table should be like this: On column Cost i need to get the price from pricelist

Service CodeDate of SaleCost
A12/03/20194.75
A25/01/20194.5
B15/02/20198.5
B19/05/20199.5
B07/04/2018"error"

<tbody>
</tbody>


Is this possible???
 
Upvote 0
See if this works for you;


Book1
ABCD
1Service CodeRate Valid From (dd/mm/yy)Rate Valid to (dd/mm/yy)Rate
2A15-03-1914-04-195.25
3A15-02-1914-03-194.75
4A15-01-1914-02-194.5
5B03-04-1902-05-199.5
6B12-06-1811-07-188.5
7
8Service CodeDate of SaleCost
9A12-03-194.75
10A25-01-194.5
11A18-03-195.25
12B02-05-199.5
13B07-04-180
14B27-06-188.5
Sheet1
Cell Formulas
RangeFormula
C2=EDATE(B2,1)-1
C9=SUMPRODUCT((B9>=$B$2:$B$6)*(B9<=$C$2:$C$6)*(A9=$A$2:$A$6)*$D$2:$D$6)
 
Last edited:
Upvote 0
See if this works for you;

ABCD
1Service CodeRate Valid From (dd/mm/yy)Rate Valid to (dd/mm/yy)Rate
2A15-03-1914-04-195.25
3A15-02-1914-03-194.75
4A15-01-1914-02-194.5
5B03-04-1902-05-199.5
6B12-06-1811-07-188.5
7
8Service CodeDate of SaleCost
9A12-03-194.75
10A25-01-194.5
11A18-03-195.25
12B02-05-199.5
13B07-04-180
14B27-06-188.5

<tbody>
</tbody>
Sheet1

Worksheet Formulas
CellFormula
C2=EDATE(B2,1)-1
C9=SUMPRODUCT((B9>=$B$2:$B$6)*(B9<=$C$2:$C$6)*(A9=$A$2:$A$6)*$D$2:$D$6)

<tbody>
</tbody>

<tbody>
</tbody>


Thank you for your answer

Shouldn't this function work even if sales logs belong to different sheet than pricelist?
 
Upvote 0
Yes it will, we just need to add sheet references into the formula for your sheet names.
 
Upvote 0
Hi Savene:

Another option:

=IF(AND(B1<=VLOOKUP(A1,Sheet2!$A$1:$B$4,2,0),C1>=VLOOKUP(A1,Sheet2!$A$1:$B$4,2,0)),"Won","")
 
Upvote 0
Yes it will, we just need to add sheet references into the formula for your sheet names.

I dont know why i cant get it to work.
I copied as you offer it but still i get error
(I have copied the EDATE to all "C" column cells)
 
Upvote 0

Forum statistics

Threads
1,215,022
Messages
6,122,716
Members
449,093
Latest member
Mnur

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