Need Help: Count based on 2 Different in VBA (Dates in Indian Date Format)

Mahantesh_Torgal

New Member
Joined
Sep 12, 2016
Messages
25
Hi Excel Masters,

I need to count few items in Different column(Eg. Column A) based on start & end Date(column B).

However , dates are in Indian Date Format (01-Jan-2018).

Attached is the sample file.

E.g: If 'Lenovo T450' , i want to count them between '01-May-2018' & '21-May-2018' in VBA.

I tried but Date is coming as US Format (5/1/2018) & (5/21/2018) in code which i want in INDIAN Date format.

Can any one please help. Please check below data and let me know result.

I Need DATES IN INDIAN DATE Format only

[TABLE="width: 238"]
<colgroup><col><col></colgroup><tbody>[TR]
[TD]Assigned Date[/TD]
[TD]Laptop Model[/TD]
[/TR]
[TR]
[TD]18-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]18-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]10-Jun-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]18-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]18-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]5-Mar-16[/TD]
[TD]Lenovo T440[/TD]
[/TR]
[TR]
[TD]18-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]17-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]18-Mar-16[/TD]
[TD]Lenovo T440[/TD]
[/TR]
[TR]
[TD]15-Apr-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]11-Apr-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]22-Apr-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]1-Sep-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]22-Mar-16[/TD]
[TD]Lenovo T440[/TD]
[/TR]
[TR]
[TD]15-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]11-Aug-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]14-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]19-May-16[/TD]
[TD]Lenovo T440[/TD]
[/TR]
[TR]
[TD]15-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]4-Oct-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]15-Mar-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]2-Aug-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]4-Apr-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]4-Apr-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]6-May-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
[TR]
[TD]6-May-16[/TD]
[TD]Lenovo T450[/TD]
[/TR]
</tbody>[/TABLE]

Regards,
Mahantesh
 

Excel Facts

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".
Can you show us your VBA code ? I don't see any "2018" in your sample data ...
 
Upvote 0
Please show us your VBA code & where/what error message you get? Can you simply change the format similar to the below code

Code:
Sub test()

Dim dDate As Date
dDate = "31-May-18" ' "31-May-18" = #5/31/2018#

Debug.Print Format(dDate, "dd-mmm-yyyy")

End Sub
 
Upvote 0

Forum statistics

Threads
1,226,218
Messages
6,189,693
Members
453,563
Latest member
Aswathimsanil

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