• 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
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Calculate an hour for a line that is a line above a given condition|General Excel Questions & Answers|Excel Forum|My Online Training Hub

You are here: Home / Calculate an hour for a line that is a line above a given condition|General Excel Questions & Answers|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
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…Calculate an hour for a line that i…
sp_PrintTopic sp_TopicIcon
Calculate an hour for a line that is a line above a given condition
Avatar
lea cohen
Member
Members
Level 0
Forum Posts: 219
Member Since:
March 10, 2016
sp_UserOfflineSmall Offline
1
March 7, 2022 - 1:22 pm
sp_Permalink sp_Print

Hi,
Attached File
Thanks for the help
I need to calculate a certain line in it and need the Excel to know how to take the relevant line -
If it's Yom Kippur
So give me the summary of the hours of the day before - the eve of Yom Kippur
And the day after-
How to make Excel calculate the sum of column F
In the line above and in the line below - for a certain figure ??
Here in the attachment a summary should be obtained - 8.5

Since I have to set it for all the holidays
I would love to get help defining a calculation from a different line
Then I will continue to define the same solution for the rest of the holidays.

Thank you!! Leah

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4438
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
2
March 7, 2022 - 8:12 pm
sp_Permalink sp_Print

Hi Lea,

It's a bit hard to follow your example as I'm not sure where you got 8.5 from because that's 3 days before Yom Kipur i.e. on the 13th September.

That said, why don't you try INDEX & MATCH to find Yom Kipur -1 e.g.

=INDEX(F2:F32,MATCH("Yom Kipur",G2:G32,0)-1)

Mynda

Avatar
lea cohen
Member
Members
Level 0
Forum Posts: 219
Member Since:
March 10, 2016
sp_UserOfflineSmall Offline
3
March 7, 2022 - 10:36 pm
sp_Permalink sp_Print

According to the example - the cells that Excel needs to sum up are F16: F18
I also need to summarize a line before Yom Kippur
And also a line after Yom Kippur
And the INDEX MATCH function only pulls out one statistic for me.
How can I set a summary for these cells?
I also need it to be done for all the holidays and not just for Yom Kippur -
How can this be defined?

Thank you for listening
And for the professional answer !!
Leah

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4438
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
4
March 8, 2022 - 9:51 am
sp_Permalink sp_Print

Thanks for clarifying. You can use this formula:

=SUM(INDEX(F2:F32,MATCH("Yom Kipur",G2:G32,0)-1):INDEX(F2:F32,MATCH("Yom Kipur",G2:G32,0)+1))

Obviously for Rosh Hashana, you will need to modify the formula to this:

=SUM(INDEX(F2:F32,MATCH("Yom Kipur",G2:G32,0)-1):INDEX(F2:F32,MATCH("Yom Kipur",G2:G32,0)+2))

Mynda
Avatar
lea cohen
Member
Members
Level 0
Forum Posts: 219
Member Since:
March 10, 2016
sp_UserOfflineSmall Offline
5
March 8, 2022 - 10:26 am
sp_Permalink sp_Print

Thank you Minda for the answer !!
The formula still does not work for me
I got 17 hours - it is not clear to me which cells he calculated
Attaches the file with coloring-
For every holiday I need the day before and the day after -
For example here in the file summarize all the orange cells
I would love to know how to do it?

Thank you for listening
And patience for my question
Leah

Avatar
lea cohen
Member
Members
Level 0
Forum Posts: 219
Member Since:
March 10, 2016
sp_UserOfflineSmall Offline
6
March 8, 2022 - 10:33 am
sp_Permalink sp_Print

I wrote here now a long function -
In the yellow cell in the attachment
Is there a way to write it shorter?
Is there a possibility for Sukkot - do not define Sukkot 1 and Sukkot 2
And that he knew how to take Sukkot twice ??
Thank you!!! Leah

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Andy Kirby, Ben Hughes, Alison West, Jill Niemeier, Laxmi Praveen, Francis Drouillard
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
yashal minahil
Oluwadamilola Ogun
Yannik H
dectator mang
Francis Drouillard
Orlando Inocente
Jovitha Clemence
Maloxat Axmatovna
Ricardo Freitas
Marko Meglic
Forum Stats:
Groups: 3
Forums: 24
Topics: 6201
Posts: 27185

 

Member Stats:
Guest Posters: 49
Members: 31861
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.