Find date

linkn00

New Member
Joined
Aug 15, 2019
Messages
44
Office Version
  1. 365
Platform
  1. Windows
Hello Mr Excel,

I have a calendar that setup to look like a calendar. I need a normal look formula that could find the first day and the last day of an event.


[TABLE="class: grid, width: 644"]
<colgroup><col span="9"><col></colgroup><tbody>[TR]
[TD]sun
[/TD]
[TD]mon[/TD]
[TD]tue[/TD]
[TD]wen[/TD]
[TD]thu[/TD]
[TD]fri[/TD]
[TD]sat[/TD]
[TD] [/TD]
[TD]look up[/TD]
[TD]a[/TD]
[/TR]
[TR]
[TD="align: right"]26-Aug
[/TD]
[TD="align: right"]27-Aug[/TD]
[TD="align: right"]28-Aug[/TD]
[TD="align: right"]29-Aug[/TD]
[TD="align: right"]30-Aug[/TD]
[TD="align: right"]31-Aug[/TD]
[TD="align: right"]1-Sep[/TD]
[TD] [/TD]
[TD]first day[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]a[/TD]
[TD]b[/TD]
[TD]a[/TD]
[TD]a[/TD]
[TD]a[/TD]
[TD]a[/TD]
[TD] [/TD]
[TD]last day[/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]a[/TD]
[TD]a[/TD]
[TD]d
[/TD]
[TD]c[/TD]
[TD]c[/TD]
[TD]c[/TD]
[TD]c[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD="align: right"]31-Aug[/TD]
[TD="align: right"]1-Sep[/TD]
[TD="align: right"]2-Sep[/TD]
[TD="align: right"]3-Sep
[/TD]
[TD="align: right"]4-Sep[/TD]
[TD="align: right"]5-Sep
[/TD]
[TD="align: right"]6-Sep[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]
[/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]e[/TD]
[TD]b[/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD] [/TD]
[TD] [/TD]
[TD] [/TD]
[/TR]
[TR]
[TD]e[/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]e[/TD]
[TD]a
[/TD]
[TD] [/TD]
[TD] [/TD]
[TD]
[/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
supposing your data in range (A2:G5) and i2=a
in cells I4 and I5 respectively those tow array formulas
Code:
=MIN((MIN(IF($A$4:$G$4=$I$2,$A$3:$G$3,""))),(MIN(IF($A$5:$G$5=$I$2,$A$3:$G$3,""))))

=MAX((MAX(IF($A$4:$G$4=$I$2,$A$3:$G$3,""))),(MAX(IF($A$5:$G$5=$I$2,$A$3:$G$3,""))))

ABCDEFGHI
sunmontuewedthufrisata
abaaaaa
cadbcac

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]2[/TD]

[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]26-Aug[/TD]
[TD="align: right"]27-Aug[/TD]
[TD="align: right"]28-Aug[/TD]
[TD="align: right"]29-Aug[/TD]
[TD="align: right"]30-Aug[/TD]
[TD="align: right"]31-Aug[/TD]
[TD="align: right"]1-Sep[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"][/TD]
[TD="align: right"]26-Aug[/TD]

[TD="align: center"]5[/TD]

[TD="align: right"][/TD]
[TD="align: right"]1-Sep[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]I4[/TH]
[TD="align: left"]{=MIN((MIN(IF($A$4:$G$4=I2,$A$3:$G$3,""))),(MIN(IF($A$5:$G$5=I2,$A$3:$G$3,""))))}[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]I5[/TH]
[TD="align: left"]{=MAX((MAX(IF($A$4:$G$4=I2,$A$3:$G$3,""))),(MAX(IF($A$5:$G$5=I2,$A$3:$G$3,""))))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0
supposing your data in range (A2:G5) and i2=a
in cells I4 and I5 respectively those tow array formulas
Code:
=MIN((MIN(IF($A$4:$G$4=$I$2,$A$3:$G$3,""))),(MIN(IF($A$5:$G$5=$I$2,$A$3:$G$3,""))))

=MAX((MAX(IF($A$4:$G$4=$I$2,$A$3:$G$3,""))),(MAX(IF($A$5:$G$5=$I$2,$A$3:$G$3,""))))

ABCDEFGHI
sunmontuewedthufrisata
abaaaaa
cadbcac

<tbody>
[TD="align: center"]2[/TD]

[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]26-Aug[/TD]
[TD="align: right"]27-Aug[/TD]
[TD="align: right"]28-Aug[/TD]
[TD="align: right"]29-Aug[/TD]
[TD="align: right"]30-Aug[/TD]
[TD="align: right"]31-Aug[/TD]
[TD="align: right"]1-Sep[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"][/TD]
[TD="align: right"]26-Aug[/TD]

[TD="align: center"]5[/TD]

[TD="align: right"][/TD]
[TD="align: right"]1-Sep[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<tbody>[TR]
[TH]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
[TR]
[TH]I4[/TH]
[TD="align: left"]{=MIN((MIN(IF($A$4:$G$4=I2,$A$3:$G$3,""))),(MIN(IF($A$5:$G$5=I2,$A$3:$G$3,""))))}[/TD]
[/TR]
[TR]
[TH]I5[/TH]
[TD="align: left"]{=MAX((MAX(IF($A$4:$G$4=I2,$A$3:$G$3,""))),(MAX(IF($A$5:$G$5=I2,$A$3:$G$3,""))))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself
[/TD]
[/TR]
</tbody>[/TABLE]

Thanks, I thought about this but this only work for 1 week. However i need to look through 17 weeks
 
Upvote 0
You can also use this Macro (for simple)
Code:
Option Explicit
Sub Give_Max_Min()
Rem===>> Createsd By Salim Hasan On 28/8/2019
Const ro = 3
Dim min_col%, max_col%
Dim rg_4 As Range
Dim cel As Range


Set rg_4 = Range("A4:G5")
    For Each cel In rg_4
        If cel = Range("i2") Then
         min_col = cel.Column
         Exit For
        End If
    Next
  For Each cel In rg_4
    If cel = Range("i2") Then
    max_col = cel.Column
    End If
  Next
  With Range("i4:i5")
  .Cells(1) = Cells(ro, min_col)
  .Cells(2) = Cells(ro, max_col)
  .NumberFormat = "d-mmm"
  End With
End Sub
 
Upvote 0
supposing your data in range (A2:G5) and i2=a
in cells I4 and I5 respectively those tow array formulas
Code:
=MIN((MIN(IF($A$4:$G$4=$I$2,$A$3:$G$3,""))),(MIN(IF($A$5:$G$5=$I$2,$A$3:$G$3,""))))

=MAX((MAX(IF($A$4:$G$4=$I$2,$A$3:$G$3,""))),(MAX(IF($A$5:$G$5=$I$2,$A$3:$G$3,""))))

ABCDEFGHI
sunmontuewedthufrisata
abaaaaa
cadbcac

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
[TD="align: center"]2[/TD]

[TD="align: right"][/TD]

[TD="align: center"]3[/TD]
[TD="align: right"]26-Aug[/TD]
[TD="align: right"]27-Aug[/TD]
[TD="align: right"]28-Aug[/TD]
[TD="align: right"]29-Aug[/TD]
[TD="align: right"]30-Aug[/TD]
[TD="align: right"]31-Aug[/TD]
[TD="align: right"]1-Sep[/TD]
[TD="align: right"][/TD]
[TD="align: right"][/TD]

[TD="align: center"]4[/TD]

[TD="align: right"][/TD]
[TD="align: right"]26-Aug[/TD]

[TD="align: center"]5[/TD]

[TD="align: right"][/TD]
[TD="align: right"]1-Sep[/TD]

</tbody>
Sheet1

[TABLE="width: 85%"]
<tbody>[TR]
[TD]Array Formulas[TABLE="width: 100%"]
<thead>[TR="bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]
[TH="width: 10px"]Cell[/TH]
[TH="align: left"]Formula[/TH]
[/TR]
</thead><tbody>[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]I4[/TH]
[TD="align: left"]{=MIN((MIN(IF($A$4:$G$4=I2,$A$3:$G$3,""))),(MIN(IF($A$5:$G$5=I2,$A$3:$G$3,""))))}[/TD]
[/TR]
[TR]
[TH="width: 10px, bgcolor: [URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=DAE7F5]#DAE7F5[/URL] "]I5[/TH]
[TD="align: left"]{=MAX((MAX(IF($A$4:$G$4=I2,$A$3:$G$3,""))),(MAX(IF($A$5:$G$5=I2,$A$3:$G$3,""))))}[/TD]
[/TR]
</tbody>[/TABLE]
Entered with Ctrl+Shift+Enter. If entered correctly, Excel will surround with curly braces {}.
Note: Do not try and enter the {} manually yourself[/TD]
[/TR]
</tbody>[/TABLE]
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,182
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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