Leasing Report Progress

a_t83

New Member
Joined
Sep 16, 2015
Messages
11
Please check the below table for each leasing agent:


Client
Status

<tbody>
</tbody>
Just BrowsingInterestedOn the FenceHook Line & SinkerLead Lost
1Active
14-Jul-19

<tbody>
</tbody>
15-Jul-19

<tbody>
</tbody>
16-Jul-19

<tbody>
</tbody>
17-Jul-19

<tbody>
</tbody>
2Active
9-May-19

<tbody>
</tbody>
16-Sep-19

<tbody>
</tbody>
3Active9-Apr-195-May-19

<tbody>
</tbody>

I need to count 5 categories as the below:

1- Just Browsing
2- Interested
3- On the Fence
4- Hook Line & Sinker
5- Lead Lost

But I want to count the last date of the progress without deleting the date/s before.

For example, in Client 1 we need to count only (Hook Line & Sinker), and Client 2 we will count only (On the Fence), etc

The results I need to be as the below:

Progress UpdateClients Status
Just Browsing5
Interested6
On the Fence4
Hook Line & Sinker6
Lead Lost2

<tbody>
</tbody>



Please let me know if this it clear.
 
Last edited:

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
Here is a VBA solution that will work for you. Make sure your raw data is on a sheet called Data and the Results are on a sheet named Results. Put your Results headers in column A starting with A1.

Code:
Option Explicit


Sub Leasing()
    Dim s1 As Worksheet, s2 As Worksheet
    Set s1 = Sheets("Data")
    Set s2 = Sheets("Results")
    Dim a As Long, b As Long, c As Long, d As Long, e As Long
    Dim lr As Long, lc As Long, i As Long
    Application.ScreenUpdating = False
    a = 0
    b = 0
    c = 0
    d = 0
    e = 0
    lr = s1.Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lr
        lc = s1.Cells(i, Columns.Count).End(xlToLeft).Column
        If lc = 3 Then a = a + 1
        If lc = 4 Then b = b + 1
        If lc = 5 Then c = c + 1
        If lc = 6 Then d = d + 1
        If lc = 7 Then e = e + 1
    Next i
    s2.Range("B1") = a
    s2.Range("B2") = b
    s2.Range("B3") = c
    s2.Range("B4") = d
    s2.Range("B5") = e
    Application.ScreenUpdating = True
    MsgBox "Action Complete"




End Sub
Sheet Data
vABCDEFG
1ClientStatusJust BrowsingInterestedOn the FenceHook Line & SinkerLead Lost
21Active7/14/20197/15/20197/16/20197/17/2019
32Active5/9/20199/16/2019
43Active4/9/20195/5/2019
54Active7/14/20197/15/20197/16/20197/17/2019
65Active5/9/20199/16/2019
76Active4/9/20195/5/2019
87Active7/14/20197/15/20197/16/20197/17/2019
98Active5/9/20199/16/2019
109Active4/9/20195/5/2019
Sheet Results
vAB
1Just Browsing0
2Interested0
3On the Fence3
4Hook Line & Sinker3
5Lead Lost3
 
Upvote 0
Many thanks it's working perfectly.

Here is a VBA solution that will work for you. Make sure your raw data is on a sheet called Data and the Results are on a sheet named Results. Put your Results headers in column A starting with A1.

Code:
Option Explicit


Sub Leasing()
    Dim s1 As Worksheet, s2 As Worksheet
    Set s1 = Sheets("Data")
    Set s2 = Sheets("Results")
    Dim a As Long, b As Long, c As Long, d As Long, e As Long
    Dim lr As Long, lc As Long, i As Long
    Application.ScreenUpdating = False
    a = 0
    b = 0
    c = 0
    d = 0
    e = 0
    lr = s1.Range("A" & Rows.Count).End(xlUp).Row
    For i = 2 To lr
        lc = s1.Cells(i, Columns.Count).End(xlToLeft).Column
        If lc = 3 Then a = a + 1
        If lc = 4 Then b = b + 1
        If lc = 5 Then c = c + 1
        If lc = 6 Then d = d + 1
        If lc = 7 Then e = e + 1
    Next i
    s2.Range("B1") = a
    s2.Range("B2") = b
    s2.Range("B3") = c
    s2.Range("B4") = d
    s2.Range("B5") = e
    Application.ScreenUpdating = True
    MsgBox "Action Complete"




End Sub
Sheet Data
vABCDEFG
1ClientStatusJust BrowsingInterestedOn the FenceHook Line & SinkerLead Lost
21Active7/14/20197/15/20197/16/20197/17/2019
32Active5/9/20199/16/2019
43Active4/9/20195/5/2019
54Active7/14/20197/15/20197/16/20197/17/2019
65Active5/9/20199/16/2019
76Active4/9/20195/5/2019
87Active7/14/20197/15/20197/16/20197/17/2019
98Active5/9/20199/16/2019
109Active4/9/20195/5/2019

<tbody>
</tbody>
Sheet Results
vAB
1Just Browsing0
2Interested0
3On the Fence3
4Hook Line & Sinker3
5Lead Lost3

<tbody>
</tbody>
 
Upvote 0

Forum statistics

Threads
1,214,606
Messages
6,120,490
Members
448,967
Latest member
visheshkotha

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