Cell value change with Month

PanchoVilla

I'm trying to have certain dates out of the week from day 1 to the last day of the month when I type a month in a cell for example:

If cell "I6" Contains "March" or whatever month:

                      " MARCH "

then:

  • cell "F10" = 1-Mar for- Sun (first Sunday of the month)
  • Cell "F11" = 5-Mar for -Thur (First Thursday of the month)
  • Cell "F12" = 8-Mar for -Sun (second Sunday of the the month and so on)
  • Cell "F13" =12-Mar for -Thur

Is this possible? I have look in different sites but no luck many thanks.

Rajesh S

You may use this also:

enter image description here

How it works:

  • In Cell K23, enter 1st Date of the Month (like I've used 02/01/2020, format is, MM/DD/YYYY ).
  • Apply MMM YY to the Cell.
  • Formula in cell K25:

=K$23+MOD(7-WEEKDAY(K$23,2),7)

  • Next, formula in Cell K26:

=K$23+MOD(4-WEEKDAY(K$23,2),7)

N.B.: In above formula 7 & 4 represents Sunday and Thursday, and you may edit then as your need.

  • Final formula in Cell K27 & fill it down:

    =IFERROR(IF(AND(MONTH(K26)=MONTH(K$23),COUNT(J$25:J25)=7),"",K25+7),"")
    
  • Now enter this formula in Cell J25 & fill down.

=IF(ISBLANK(K25),"",K25)


Edited:

OP has raised a good point that how to manage dates if and when Sunday & Thursday are more than 8 (like in May, August Sundays are 5 and Thursdays are 4).

enter image description here

  • Enter this Formula in Cell L25:

    =SUMPRODUCT(N(TEXT(ROW(INDIRECT(K25&":"&EOMONTH(K25,0))),"ddd")="Sun"))+SUMPRODUCT(N(TEXT(ROW(INDIRECT(K25&":"&EOMONTH(K25,0))),"ddd")="Thu"))
    

N.B. This Counts Sundays & Thursdays, where Sun and Thu are editable.

  • Formula in K27:

=K$25+MOD(7-WEEKDAY(K$25,2),7)

  • Formula in Cell k28:

=K$25+MOD(4-WEEKDAY(K$25,2),7)

  • Enter formula in Cell K29:

      =IFERROR(IF(AND(MONTH(K28)=MONTH(K$25),COUNT(J$27:J27)>=(L$25-1)),"",K27+7),"")
    

N.B.

  • Use of MONTH check & ROW COUNT with formula in Cell K27 & K29, restricts Excel to produce only DATEs for all Sundays & Thursdays.
  • Now keep changing Date & Year in cell K23 or in K25 as needed.
  • Adjust cell references in the formula as needed.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Change Cell Value if There is Overflow

From Dev

Change value of cell in Javascript

From Dev

Change value in a cell based on value in another cell

From Dev

Return one cell value based on month in another cell

From Dev

If cell contains partial string, then change cell value

From Dev

Change DataGridView Cell Value Programmatically

From Dev

change cell in datagridview to empty value

From Dev

VBA Change Cell Value On Insert

From Dev

Change the value in a cell in a datagrid (binding)

From Dev

Change Formula =Hyperlink Cell Value

From Dev

Change datagriview cell value on CellValidating

From Dev

change cell value on button click

From Dev

Change colour of a cell based on the value in the cell and text in another cell

From Dev

Change the formatting of a cell depending on the value of that cell and another cell

From Dev

Kendo Scheduler change today's cell background color in month view

From Dev

How to Change Conditional Formatting of a Cell Based on a Change in the Cell Value

From Dev

excel macro : Change cell value dependant on original cell value

From Dev

How to change value of one cell onchange of other cell value in DataGridview

From Dev

How to change cell value repeatedly by entering the value in other cell or sheet?

From Dev

Change a cell's color on value of another cell, then change to a different color if I put a value into the cell

From Dev

Copy and paste row in new sheet with changes in cell value (month) based on other cell value

From Dev

extjs change grid cell background based on value

From Dev

janus gridex change cell value at runtime?

From Dev

datatables: how to change the value of a cell on spacebar?

From Dev

How to change a cell's value in dataframe with pySpark?

From Dev

Cell Value Change Event and Running a Continuous Macro

From Dev

Handsontable : how to change cell value in render function

From Dev

Change cell value if checkbox selected - dhtmlxGrid in RoR

From Dev

change UICollectionView cell's alpha value not working

Related Related

  1. 1

    Change Cell Value if There is Overflow

  2. 2

    Change value of cell in Javascript

  3. 3

    Change value in a cell based on value in another cell

  4. 4

    Return one cell value based on month in another cell

  5. 5

    If cell contains partial string, then change cell value

  6. 6

    Change DataGridView Cell Value Programmatically

  7. 7

    change cell in datagridview to empty value

  8. 8

    VBA Change Cell Value On Insert

  9. 9

    Change the value in a cell in a datagrid (binding)

  10. 10

    Change Formula =Hyperlink Cell Value

  11. 11

    Change datagriview cell value on CellValidating

  12. 12

    change cell value on button click

  13. 13

    Change colour of a cell based on the value in the cell and text in another cell

  14. 14

    Change the formatting of a cell depending on the value of that cell and another cell

  15. 15

    Kendo Scheduler change today's cell background color in month view

  16. 16

    How to Change Conditional Formatting of a Cell Based on a Change in the Cell Value

  17. 17

    excel macro : Change cell value dependant on original cell value

  18. 18

    How to change value of one cell onchange of other cell value in DataGridview

  19. 19

    How to change cell value repeatedly by entering the value in other cell or sheet?

  20. 20

    Change a cell's color on value of another cell, then change to a different color if I put a value into the cell

  21. 21

    Copy and paste row in new sheet with changes in cell value (month) based on other cell value

  22. 22

    extjs change grid cell background based on value

  23. 23

    janus gridex change cell value at runtime?

  24. 24

    datatables: how to change the value of a cell on spacebar?

  25. 25

    How to change a cell's value in dataframe with pySpark?

  26. 26

    Cell Value Change Event and Running a Continuous Macro

  27. 27

    Handsontable : how to change cell value in render function

  28. 28

    Change cell value if checkbox selected - dhtmlxGrid in RoR

  29. 29

    change UICollectionView cell's alpha value not working

HotTag

Archive