If cells b5, d5, and/or g5 are empty (one or all), run a formula to calculate a due date

eabaker64

New Member
Joined
Jul 1, 2024
Messages
35
Office Version
  1. 365
Platform
  1. Windows
Hi. I need a formula in B3 to look at cells B5, D5 and G5. If any of those cells are blank, a formula is run which calculates a date that is 15 workdays after a date showing in cell B2. If cells B5, D5 and G5 all contain data, the formula does not run and instead returns a value of N/A in cell B3. I have this formula but if any of the B5, D5, or G5 cells have data, it returns N/A. I don't want it to return N/A unless all three cells contain data. Any ideas?

=IF(B5<>"","N/A",IF(D5<>"","N/A",IF(G5<>"","N/A",IF(B2<>"",WORKDAY(B2,15),""))))
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Give this a try:
Book1
ABCDEFG
1
27/1/2024
3N/A
4
5xyz123abc
Sheet1
Cell Formulas
RangeFormula
B3B3=IF(COUNTA(B5,D5,G5)<3,WORKDAY(B2,15),"N/A")
 
Upvote 0
Solution
Give this a try:
Book1
ABCDEFG
1
27/1/2024
3N/A
4
5xyz123abc
Sheet1
Cell Formulas
RangeFormula
B3B3=IF(COUNTA(B5,D5,G5)<3,WORKDAY(B2,15),"N/A")
OMG, you are awesome!!! It has taken me all day not to be able to figure out what it took you a very short time to do. Thank you so much!!!
 
Upvote 0
Okay, one more question. I have attached the spreadsheet so you can see what I am trying to do. The formula you gave me is in B7 (1st follow up due to send back:) and works perfectly. G9 has not been filled in so the formula calculates the 15 days and gives me another due date. Now I want it to do the same thing in D7 (calculate a due date 10 working days) or N/A if G9 is filled in, but I don't want it to remove the due date in B7. How can I keep the due date in B7, but have it show N/A in D7 because a date has been entered in G9? Thank you for your assistance - greatly appreciated!
 

Attachments

  • Screenshot 2024-07-02 074729.png
    Screenshot 2024-07-02 074729.png
    21.9 KB · Views: 4
  • Screenshot 2024-07-02 074843.png
    Screenshot 2024-07-02 074843.png
    20.4 KB · Views: 4
Upvote 0
Are you able to use the XL2BB mini sheet addon or can you at least take a screenshot with row/column information? I can't tell what is what by your pictures.
 
Upvote 0
Okay, so if G9 is filled in, the formula in B7 says it should return "N/A" (because B9 and D9 are also filled in). But you want the date to stay in B7 even though B9, D9, and G9 are filled in? If so, this is going to require a VBA approach instead of formula, because you can only have 1 value in a cell at a time, either a formula or a hard coded value.
 
Upvote 0
Okay, so if G9 is filled in, the formula in B7 says it should return "N/A" (because B9 and D9 are also filled in). But you want the date to stay in B7 even though B9, D9, and G9 are filled in? If so, this is going to require a VBA approach instead of formula, because you can only have 1 value in a cell at a time, either a formula or a hard coded value.
Okay. I see what you are saying. Thank you for your assistance, I really do appreciate it. I might have to make some changes to the spreadsheet.
 
Upvote 0
I have not worked with VBA for several years and even then, it was hunting through forums and videos to find what I needed. I am not having as much luck with this in trying to figure out a VBA code to do what I want. Any ideas? And if not, thank you for all you have done!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

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