Problem with copying dates and search for a date in a column

DarkoDeign2

Board Regular
Joined
Jun 20, 2023
Messages
76
Office Version
  1. 365
Platform
  1. Windows
Hi,

Col B3 has a date
Col B4:B1500 contains a formula that checks if B4 and D4 iempty. If both cells are empty do nothing. If D4 is empty then B4 should show nothing. But if D4 has text, the B4 should show the value from the closest cell above that contains a date. The formula in this file has a slighty different function and is not working for me, as it show the wrong date. What should I change in the formulas in col B4:B1500?


Book1
BD
2DateTopic
32023-07-26BBQ Party
41900-01-00Pay electrical bills
51900-01-00Renew subrscription of newspaper
61900-01-00Get a hair cut
7 
81900-01-00sd
Sheet1
Cell Formulas
RangeFormula
B4:B8B4=IF(D4="","",IF(B4="","Enter date", B3))
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
Dark, I am not sure that your formula should work the way you want it to because you reference B4 in B4, So let's start with a question. What date do you want to pay your electrical bills?
 
Upvote 0
I would like to pay my electrical bill the same date as the cell above (2023-07-26)
 
Upvote 0
Darko how do you feel about a VBA program? There may be somebody out there that can solve your problem with formulas, but I am not one of them.
 
Upvote 0
Can you show us what your sheet looks like before any formulas are entered into column B?

Is there only one cell in column B with a date (B3 in your sample)? If more than one, please include more than one in your sample data.
 
Upvote 0
It is only one cell B3 that has a date. The rest of the cells in col B are empty.
 
Upvote 0
Thanks for the additional information

cells in col B are empty.
In that case there is no need for the formula to check if column B is empty.

Does this do what you want?

DarkoDeign2_1.xlsm
BD
1
2DateTopic
326/07/2023BBQ Party
426/07/2023Pay electrical bills
526/07/2023Renew subrscription of newspaper
626/07/2023Get a hair cut
7 
826/07/2023sd
Sheet1
Cell Formulas
RangeFormula
B4:B8B4=IF(D4="","",LOOKUP(9^9,B$3:B3))
 
Upvote 0
Thanks! this works fine.
I would like to continue to build on the formula. In the example there is a blank row on row 7.
If there are blank rows I would like the next cell B8 to show the date from the closest cell in col b and add 7 days to that date.
So in this case I would like the date in cell B8 to be 03/08/2023.
 
Upvote 0
7 days added to 26 July give 2 August for me, not 3 August. :confused:

Try below.

BTW, best to give us the full requirement to start with. Building bit by bit often means that the right strategy is not commenced from the beginning and all the early work is wasted when a completely different approach is eventually required by one of the added bits. ;)

DarkoDeign2_1.xlsm
BD
1
2DateTopic
326/07/2023BBQ Party
426/07/2023Pay electrical bills
526/07/2023Renew subrscription of newspaper
626/07/2023Get a hair cut
7 
82/08/2023sd
Sheet1
Cell Formulas
RangeFormula
B4:B8B4=IF(D4="","",LOOKUP(9^9,B$3:B3)+7*(B3=""))
 
Upvote 1
Solution

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