Adding text to a column based on value in another column

exceluser29

New Member
Joined
Sep 8, 2010
Messages
10
Hi,

I have two tables in hand:
Table 1: has data showing Customer no, Renewal Month, last_active_date, report_pull_dt and other columns.

Table 2: has Renewal Month and Cancel Dt Limit

What I have to do is add a column in table 1 (Status) based on their last_active_date .

For example, If renewal Month is July and last_active_date < Cancel Dt Limit, then status = 'cancel' else 'Active'.

I will have to lookup the Cancel Dt Limit from table 2, based on their renewal month.

Can someone please help? I was thinking a combination of Vlookup and if statement but dont know how to write!

Thanks!
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
The specifics of the data types being used are missing so it's hard to give a complete answer I'm afraid... eg:

Are Renewal Month / last_active_date actual date values or simply string values containing the Month Name ?
Same question holds true for Table 2 (both fields) also

Does Table 2 hold a record for every month that will be found in Table 1 ?

Is Table 2 sorted in any way ?

All of the above will dictate to some extent the options open to you.
 
Upvote 0
Hi

Renewal Month is populated with: Jan, Feb, Mar, Apr,May, June, July --till Dec. Same with Renewal Month in Table2. Last Active date, Cancel Dt Limit are all in date format: dd-mmm-yy.

Table 2 is not sorted, but I can sort it if it helps!

I could have posted a screen shot of my table but don't know how to do it, new user! Yes, table 2 hold records for every month from table 1.

Thanks for your help!

Quote:
<TABLE cellSpacing=0 cellPadding=6 width="100%" border=0><TBODY><TR><TD class=alt2 style="BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; BORDER-BOTTOM: 1px inset">Are Renewal Month / last_active_date actual date values or simply string values containing the Month Name ?
Same question holds true for Table 2 (both fields) also

Does Table 2 hold a record for every month that will be found in Table 1 ?

Is Table 2 sorted in any way ? </TD></TR></TBODY></TABLE>
All of the above will dictate to some extent the options open to you.
 
Upvote 0
Here's how my tables look:

TABLE1
Customer No Renewal Month Last Active Date Report Pull Date CustStat
1 Jan 07/15/2010 07/20/2010
2 Feb 06/13/2010 07/20/2010

TABLE2

Renewal Month Cancel Dt Limit
Jan 03/15/2010
Feb 04/15/2010
Mar 05/15/2010

What I need to do is define whether CustStat is cancel or active. If renewal month is Jan and if they have been active till cancel dt limit (Last Active Date > Cancel Dt limit) that means they are active else Cancel.

Thanks!
 
Last edited:
Upvote 0
I guess the point was more to do with Renewal Month - storing as a string rather than a date will lead to some confusion when it comes to 2011, no ?
Or do you have one file per calendar year ?
 
Upvote 0
OK - final question (I hope) - you refer to TABLE1 & TABLE2 - are you using XL2007+ Tables specifically ?
 
Upvote 0
OK. See if the below is along the lines of what you had in mind (?)

Excel Workbook
ABCDE
1Customer NoRenewal MonthLast Active DateReport Pull DateCustStat
21Jan15-Jul-1020-Jul-10Active
32Feb13-Jun-1020-Jul-10Active
43May13-Jun-1020-Jul-10Cancel
Sheet1
Excel Workbook
AB
1Renewal MonthCancel Dt Limit
2Jan15-Mar-10
3Feb15-Apr-10
4Mar15-May-10
5Apr15-Jun-10
6May16-Jul-10
7Jun14-Aug-10
8Jul14-Sep-10
9Aug14-Oct-10
10Sep14-Nov-10
11Oct14-Dec-10
12Nov14-Jan-11
13Dec14-Feb-11
Sheet2


Note: I've assumed the Cancel Limit isn't always the 15th of the month 2 months after renewal month - if it is you don't really need the lookup table.
 
Upvote 0
Thanks for your prompt reply! Yes, Cancel Dt Limit is always 2 months after Renewal Month.

I should have pointed out that Report Pull Date also plays a role in this. Sorry! This works great for cases when :
Renewal Month < Report Pull date

For cases,
when Renewal Month > Report Pull Date, even when Last Active date < Renewal Month, they can be active as the report was pulled before their renewal month.

For example, If Renewal Month = Nov, Cancel Dt Limit is 14-Jan-2011. So, If Last Active date is 20-Jul-10, they are still active as that's report pull date too. How do I incorporate this part?

Hope I am explaning it clearly.

Thanks for your help!
 
Upvote 0

Forum statistics

Threads
1,214,987
Messages
6,122,613
Members
449,090
Latest member
vivek chauhan

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