Complex IF in Range using Dates

Caren

New Member
Joined
Apr 10, 2016
Messages
2
Hi,

I need to command that if a date (Cell N6:N15) is after another date (P4) but before another date (Q4) then how many months are between Cell N and Q.
Main problem is that as I would like to drag this formula across only, at the bottom of a table, I do not know how to get it to search up and down column N, where the dates are.
I so far have figured this out:

=IF(AND($N14>P$4,$N14<q$4),(q$4-$n14) 365.25,0)

This only works for one cell in column N.

Then, I would also like the output to add itself to other outputs if there are multiple dates that come true.



75gkuzjep


Thank you :)</q$4),(q$4-$n14)>
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
if i understand correctly, replace $N14

with INDEX($N$6:$N$15,MATCH(LOOKUP(9.99E+100,P6:P15),P6:P15)), thus


Excel 2012
NOPQ
401-May-1601-Aug-16
531-Jul-1631-Oct-16
6
7
8
9
10
11
12
13
1401-Jun-16-11,100
1531-Oct-16-74,535
160.170.00
17
Sheet1
Cell Formulas
RangeFormula
P16=IF(AND(INDEX($N$6:$N$15,MATCH(LOOKUP(9.99E+100,P6:P15),P6:P15))>P$4,INDEX($N$6:$N$15,MATCH(LOOKUP(9.99E+100,P6:P15),P6:P15))),(Q$4-INDEX($N$6:$N$15,MATCH(LOOKUP(9.99E+100,P6:P15),P6:P15)))/365.25,0)
 
Upvote 0
Hi

Thank you for your efforts,

What does 9.99E+100 mean?

I have come up with a new solution

But am still stuck.

As you can see I need excel to perform the function I have highlighted in the address bar of the picture attached.

However, I want excel to know when to perform this function. Which is, when there is a non blank cell. ie. P14.

So I want to say something like this:

In cells P6:P15 are any cells non blank? ie <>""

if so then take the corresponding row of this non blank cell and carry out the formula that I have written according to the correct row. (Take the refurb end date - first date of the quarter)

The formula I have written will only work for that one row in particular.
http://s24.postimg.org/id4cqt4ut/excel.png
 
Upvote 0

Forum statistics

Threads
1,223,237
Messages
6,170,930
Members
452,367
Latest member
TePunaBloke

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