Index and Match formula

Newb10

New Member
Joined
Oct 9, 2019
Messages
7
Office Version
  1. 365
Platform
  1. Windows
Hello,

I have 2 problems that I am trying to solved. I did my best to search forums but I just cannot seem to find answers (Probably I am not able to interpret the issue properly, been learning excel for more than a month now)

1. trying to use =INDEX($B$6:$AE$57,MATCH($A66,$A$6:$A$57,0),MATCH(C$65,B5:$AE$5,0)) to identify the login time of an ID on a certain date. But it returned #N/A most likely because of a formatting issue. I am getting the data from a Pivot table.

2. I have tried to copy the Pivot table to another sheet to remove the formatting, then converted the decimals to time. The formula above worked, but some values shows 12:00:00AM even though some of the cells on the reference table doesn't have any values.

I wanted to show it using attachments but it seems that I am not allowed to.

Thanks!
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
Hi. Number 1 would require more info. If a match doesnt find a match then the result is #N/A. You havent given much away in terms of why that may be. Number 2 probablt means the index match match produces a blank cell which to excel is 0. 0 formatted as time is what you are seeing. For the 2nd one you can do this to produce a blank instead of 0.

=IF(INDEX($B$6:$AE$57,MATCH($A66,$A$6:$A$57,0),MATCH(C$65,B5:$AE$5,0))="","",INDEX($B$6:$AE$57,MATCH($A66,$A$6:$A$57,0),MATCH(C$65,B5:$AE$5,0)))
 
Upvote 0
Welcome to MrExcel!

Trying to follow what you're doing with your first question, I would suggest a slight change to the match for the date and time, assuming that the first macth in your formula is the date, try changing that part to

MATCH($A66+1,$A$6:$A$57,1)

This should work as needed as long as your data is in chronological order, but without seeing a sample of the format it is impossible to say for certain.

For your second question, empty cells are evaluated as zero by most formulas, which is the time value for midnight. A way to get around it would be to check if the original cell is empty, for example

=IF(INDEX(....)="","",INDEX(....))

Simply replace INDEX(....) with your existing formula. This should work with most formulas, not just index.
 
Upvote 0
wow! Thank you for all your help. Never would have thought that this will be answered even without me posting the screenshot. Many thanks guys! this really help :)
 
Upvote 0

Forum statistics

Threads
1,223,703
Messages
6,173,973
Members
452,540
Latest member
haasro02

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