• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Formula with dates - if a column is row is blank it needs to read one date, but if there is already an existing date then it needs to give me that date|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Formula with dates - if a column is row is blank it needs to read one date, but if there is already an existing date then it needs to give me that date|General Excel Questions & Answers|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumGeneral Excel Questions & Answe…Formula with dates - if a column is…
sp_PrintTopic sp_TopicIcon
Formula with dates - if a column is row is blank it needs to read one date, but if there is already an existing date then it needs to give me that date
Avatar
Terri Ferguson
Member
Members
Level 0
Forum Posts: 6
Member Since:
August 14, 2018
sp_UserOfflineSmall Offline
1
August 14, 2018 - 5:52 pm
sp_Permalink sp_Print

Good day everyone,  

I am looking for some help please as I have to write an Excel formula that reads dates and I am battling.  Mynda was kind enough to help me yesterday but unfortunately the formula was only partially successful so she has asked me to put it on the forum. 

                       Column B                                                                                                                                                                   Column J

AccntNo APPLICATION DATE S MAIL TITLE Ini INITIALS - 2 Client Name SURNAME - 2 Category URV date
0031 2002 06 21 5 MR/S J NT MOW MOW LM 2005 11 02
0053 2013 07 30 5 MRS JBE   JENKINS   OM  
0085 2004 04 13 6 MR/S LR P HILDITCH HILDITCH OM  
0086 2004 04 30 2 MR/S JH CL WOODMAN WOODMAN OM 2016 04 25
0090 2004 05 21 3 MR/S WG JM ANNANDALE ANNANDALE LM  

So I need a formula which reads the dates in columns B and J and that says :

If there is NO date in column J then it needs to enter the date from column B (highlighed in red), but if there is a date in column J then it needs to read that date and ignore the date in column B

Mynda suggested this formula :

=IF(NOT(ISBLANK(R2)),R2,C2)

which works perfectly for the columns where there is no date and it draws the date from column B which I need, but if I try to use it for the rows where there is a date in Column J then it stays blank. 

I am really stressing about this as my boss is back on Thursday and I need to have this sorted by then.  I have attached the actual spreadsheet so that you can see the rows and columns so that it's easier to visualise.

Any help would be very much appreciated please!

Thanks, Terri

 Excel-ss.PNGImage Enlarger

sp_PlupAttachments Attachments
  • sp_PlupImage Excel-ss.PNG (19 KB)
sp_AnswersTopicSeeAnswer See Answer
Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4519
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
August 14, 2018 - 9:05 pm
sp_Permalink sp_Print

Hi Terri,

When you emailed me your original question you said the other dates were in columns C and R, but the image and your question above say they're in columns B and J, so all you need to do is change the formula so it references columns B and J like so:

=IF(NOT(ISBLANK(J2)),J2,B2)

 

In English it says if J2 is not blank/empty, then return J2, otherwise return B2.

Hope that works.

Mynda

Avatar
Terri Ferguson
Member
Members
Level 0
Forum Posts: 6
Member Since:
August 14, 2018
sp_UserOfflineSmall Offline
3
August 14, 2018 - 11:54 pm
sp_Permalink sp_Print

Hi Mynda

So sorry I should have changed the rows and columns in your example as I simplified the spreadsheet so that it would fit in the forum page.  

That formula works perfectly for the rows where there are is no figure in column J and it correctly pulls the date from column B, but if there is a figure in column J then the formula is blank.

Could it be because I am working with dates? 

Could I email you my spreadsheet and then perhaps you could use it for training??  Or perhaps it is the formatting on the formula cell, although I have tried it as "general" and "date" formatting?

Thanks

Terri

Avatar
Terri Ferguson
Member
Members
Level 0
Forum Posts: 6
Member Since:
August 14, 2018
sp_UserOfflineSmall Offline
4
August 15, 2018 - 12:01 am
sp_Permalink sp_Print

This is the spreadsheet!

Avatar
Anders Sehlstedt
Eskilstuna, Sweden

VIP
Members


Trusted Members
Level 3
Forum Posts: 873
Member Since:
December 7, 2016
sp_UserOfflineSmall Offline
5
August 15, 2018 - 5:51 am
sp_Permalink sp_Print

Hello Terri,

You are not using the same formula in column S. For example:

In cell S7 you have =IF(NOT(ISBLANK(R7)),R7,C7)

In cell S8 you have =IF(NOT(ISBLANK(R8)),R8,C8)

In cell S9 and later you have =IF(NOT(ISBLANK(R9)),C9,R9), you have changed the order for what data to pull.

You need to use the formula you have in cells S7 and S8 for the whole S column. The reason to why you don't get the result you want is because the empty cells in R column are not empty. Click on any "empty" cell in R column, press delete key and you will see the date from C column being pulled to the S column.

Br,

Anders

sp_AnswersTopicAnswer
Answers Post
Avatar
Terri Ferguson
Member
Members
Level 0
Forum Posts: 6
Member Since:
August 14, 2018
sp_UserOfflineSmall Offline
6
August 15, 2018 - 3:40 pm
sp_Permalink sp_Print

Thank you so much Anders, column R looked empty to me but as soon as I deleted what was in that row the formula worked perfectly!!  I'm so happy as I can easily sort the spreadsheet to have all those "blank" rows together, delete them and then use the formula. 

Sorry I should have deleted the different formulas as that was me trying to play with Myanda's original formula that she gave me to see if it made any difference to the results, when what I should have been doing was just hitting delete 🙂

Thanks to everyone who helped me!  I'm off now to go and try it

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online:
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Aminu Sule
Samuel Ramirez
Abdifatah Osman
mohad borhom
Abayomi Adedeji
Ganesh MVS
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Forum Stats:
Groups: 3
Forums: 24
Topics: 6364
Posts: 27829

 

Member Stats:
Guest Posters: 49
Members: 32346
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.