• 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
You are here: Home
Lost password?
sp_Search
Advanced Search|Last Search Results
Advanced Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search

Please confirm you want to mark all posts read

Mark all topics read

sp_MobileMenu Actions
Actions
sp_LogInOut
Log In
sp_Search

Search Forums

sp_RankInfo
Ranks Information
Avatar

New/Updated Topics

General Excel Questions & Answers

  Customer Order From Facebook Page.

  Grey out master list when selected in dropdown

Dashboards & Charts

  How to link a doughnut chart with the existing slicer?

VBA & Macros

  Send Email Code Error

  how can i add windows media player in excel 2016

  Direccionar de un rango a una celda especifica

  Changing shape colours

  Need VBA code to find unique group of Repetation follow by B…

Power Query

  Need help describing what I want to accomplish

  Opening several PDFs from a Sharepoint site, and validating …

  Unpivot data in Power Query

Power Pivot

  Slicer not greyed out for items without data

  Power Pivot TopN not calculating correctly

Power Query

  pq_7.01_parameter_tables

Power BI

  How identify the URL to connect power bi with Project online

Select Forum

  Rules and Guides

Forum Rules and Guides

  Public Forums - For Registered Users

General Excel Questions & Answers

Dashboards & Charts

VBA & Macros

Power Query

Power Pivot

  Course Members Only

Excel Dashboards

Power Query

Power Pivot

Xtreme Pivot Tables

Excel for Decision Making

Excel for Finance

Power BI

Excel

Word

Outlook

Excel Expert

Excel for Customer Service Professionals

Excel Analysis Toolpak

Excel Tables

Excel for Operations Management

Financial Modelling

Advanced Excel Formulas

Pivot Tables Quick Start

ForumsGeneral Excel Questions &…
sp_TopicIcon
Index match to find first non-zero value
Avatar
Natasha Tannan
Posts: 1

Level 0
April 19, 2019 - 12:07 am

1

Hello,

Would you mind helping me put together an index match formula, which populates sheet 1 please?

I would like the formula to retrieve the value from sheet 2 based on the headers as well as the currencies. However, the first match for the example brings back a 0. How can the formula be amended so that I can get the next match, i.e. 5?

Thank you.

sp_AnswersTopicSeeAnswer
Avatar
Frans Visser
Duivendrecht (near Amsterdam) - The Netherlands
Posts: 346

Level 2
April 19, 2019 - 5:19 am

2

I´m afraid your data is not consistent for what you want, seeing your xlsx-file.

In your sheet2 under header 2 you have more than one value for each currency (GBP is 10, later -10, later 10 again and so on).

So when you want on sheet1 some value in a column with header 2, which one should it be?

Frans

Avatar
Catalin Bombea
Iasi, Romania
Posts: 1807
Level 10
April 19, 2019 - 2:27 pm

3

It's not impossible, but keep in mind that if you don't find an easy solution, most likely your data structure is not ideal and that usually leads to very complex formulas.

 

Here is a formula you can use in cell C9:

=INDEX(LookupRange,SUMPRODUCT(SMALL(ROW(LookupRange)*($E$5:$E$24=B9)*(LookupRange<>0),SUMPRODUCT(($E$5:$E$24<>B9)*(LookupRange<>0)+(LookupRange=0))+1))-ROW(LookupRange)+1)

 

The LookupRange is a defined name, with this formula:

=OFFSET(Sheet1!$E$5:$E$24,0,MATCH(Sheet1!$C$6,Sheet1!$F$4:$H$4,0))

If you use a normal tabular data structure, like the one below, without 0 values, then the formula will be much easier.

Currency Attribute Value
GBP Header 1 5.00
SEK Header 1 60.00
GBP Header 1 10.00
PLN Header 1 8.00
GBP Header 2 10.00
USD Header 2 -13.11
GBP Header 2 -10.00
USD Header 2 13.12
GBP Header 2 4.00
USD Header 2 10.00
GBP Header 2 10.00
USD Header 2 115.00
GBP Header 2 5.00
USD Header 2 8.00
GBP Header 3 45.00
USD Header 3 13.11
GBP Header 3 10.00
USD Header 3 -13.12
sp_AnswersTopicAnswer
Forum Timezone:
Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Mynda Treacy, Suzanne Halfacre, Dieneba NDIAYE, Ben Hughes, Dario Serrati, Jay Soysa
Guest(s) 6
Currently Browsing this Page:
1 Guest(s)

Devices in use: Desktop (10), Phone (2)

Forum Stats:
Groups: 3
Forums: 24
Topics: 6200
Posts: 27181
Member Stats:
Guest Posters: 49
Members: 31858
Moderators: 3
Admins: 4
© Simple:Press

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.