Evaluate a date range and return a value

StartingOut

Board Regular
Joined
Feb 1, 2011
Messages
92
Hi,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p>
I have workbook with about 500 rows using column A and B, column A has a date and column B has lust a product name. I need to evaluate the date. The evaluation is to check column A for the date and if it is between certain days, place a number value in column C<o:p></o:p>
<o:p> </o:p>
0 to 1 day old = 1 in column C<o:p></o:p>
2 to 5 days old = 2 in column C<o:p></o:p>
6 to 10 days old= 6 in column C<o:p></o:p>
11 to 20 days old = 11 in column C<o:p></o:p>
21 to 30 days old = 21 in column C<o:p></o:p>
31 to 60 days old = 31 in column C<o:p></o:p>
More than 60 days = 60 in column C<o:p></o:p>
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
0 to 1 day old = 1 in column C
2 to 5 days old = 2 in column C
6 to 10 days old= 6 in column C
11 to 20 days old = 11 in column C
21 to 30 days old = 21 in column C
31 to 60 days old = 31 in column C
More than 60 days = 60 in column C

Place =today() in cell ZZ10000:

=
IF(AND(ZZ10000-A1>60,C1=60,IF(AND(ZZ10000-A1>=0, ZZ10000-A1<=1),C1=1,IF(AND(ZZ10000-A1>=2, ZZ10000-A1<=5),C1=2,IF(AND(ZZ10000-A1>=6, ZZ10000-A1<=10),C1=6,IF(AND(ZZ10000-A1>=11, ZZ10000-A1<=20),C1=11,IF(AND(ZZ10000-A1>=21, ZZ10000-A1<=30),C1=21,IF(AND(ZZ10000-A1>=31, ZZ10000-A1<=60),C1=31,""))))))))

Not sure the end parenthesis are correct! Adjust as necessary. There has to be a better way to do this, but this should work.
 
Upvote 0
Hi, this on its own didn't work and returned an error.

=IF(AND(ZZ10000-A1>60,C1=60,IF(AND(ZZ10000-A1>=0, ZZ10000-A1<=1),C1=1,IF(AND(ZZ10000-A1>=2, ZZ10000-A1<=5),C1=2,IF(AND(ZZ10000-A1>=6, ZZ10000-A1<=10),C1=6,IF(AND(ZZ10000-A1>=11, ZZ10000-A1<=20),C1=11,IF(AND(ZZ10000-A1>=21, ZZ10000-A1<=30),C1=21,IF(AND(ZZ10000-A1>=31, ZZ10000-A1<=60),C1=31,""))))))))


And I am not sure where to place the Lookup formula.
 
Upvote 0
Ok I figured out wher to place the Loo Up its in ZZ10000 now I am getting "your formula contains an error" message" then I try taking out 1 ) then I get the message your formula is missing --) or (.
 
Upvote 0
=LOOKUP(TODAY()-A1,{0,2,6,11,21,31,61},{1,2,6,11,21,31,60})


all you need is this formula. Put this in column C.

My formula (with the 8 if functions) is an archaic and superfluous version of the formula above!
 
Upvote 0

Forum statistics

Threads
1,224,509
Messages
6,179,192
Members
452,893
Latest member
denay

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