Macro to Tell me if a customer is new old or existing?

tonywatsonhelp

Well-known Member
Joined
Feb 24, 2014
Messages
3,194
Office Version
  1. 365
  2. 2019
  3. 2016
Platform
  1. Windows
Hi Everyone,

I have a list of sales going back to 1st jan 2017

I'm want to have a macro tell me the staus of that client according to what has happened up until that row,
so for example,

all cilents are listed down Column C,

All Dates are listed down column G the sheet is in date order old to new.

in column I i want to start at row 2 look at the clients name and see if they have ordered from us before by only looking up the rows so (row two bad example) but row 100, take name Dave, look for dave, if dave appears before this row he is an existing client and in column G goes "existing" if not he is new and in g goes "new" if he is existing but I also need to know if he ordered before 2018 so if the date is after 1/1/2018 then if dave ordered in 2017 I want column H to Say "Loyal"

also I want to rerun the macro but no need to change the data so can it be stat to only fill in from the last row of data in column G?

please help if you can

Tony
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Something like this maybe (with a formula)


Book1
CDEFGHI
1CustomersDateStatus
2Dave13-Mar-18
3tony16-Jun-18
4Harry7-Nov-15
5Clarus10-Mar-15
6Armani12-Jan-18
7tarzan17-Aug-15
8James1-Oct-18
9sadiq17-Aug-18
10John23-Jul-15
11Harry19-Apr-17Loyal
12william28-Jan-16NEW
13Tony11-Feb-16OLD
14Dave28-Aug-18OLD
15Clarus19-May-17Loyal
16Raheem17-Feb-15NEW
17Tom26-Feb-15NEW
18Bill10-Mar-15NEW
19Michael5-Oct-18NEW
20Cheikh5-May-16NEW
21Sadiq13-Aug-18OLD
22Donald28-May-17NEW
23Lyndon16-Apr-17NEW
Sheet2
Cell Formulas
RangeFormula
I11=IF(COUNTIF($C$2:$C$10,$C11)=0,"NEW",IF(COUNTIFS($C$2:$C10,$C11,$G$2:$G10,"<01/01/2018")>0,"Loyal","OLD"))
 
Upvote 0

Forum statistics

Threads
1,215,124
Messages
6,123,189
Members
449,090
Latest member
bes000

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