Trying to find the last number in a row, but getting errors because of #N/A returns.

AustSportingPix

New Member
Joined
Oct 5, 2020
Messages
42
Office Version
  1. 365
Platform
  1. Windows
  2. MacOS
  3. Mobile
So my horse racing ratings are coming along, theyre finding winners and value runners.


My database table is a large file. In it, I want to find the peak return, average return (they're both done), plus the returns for each of the last 10 returns for each horse.

The table will have a column for each date from 2020/09/23 to as far as it will take me.

The problem is horses aren't running every day, so finding the returns for the last start to the 10th last isn't returning a value because the vLookups I'm using are returning a "#N/A" value if the horse didn't race that day.

The formula I'm using to find the last result is: =IFERROR(INDEX('All Horse Ratings.xlsx'!Allhorses[@[20200923]:[20201106]],1,COUNTA($Q2:$BI2)),"") (I change this in a few cells to get the last 10 results)
The formula I'm using to get the ratings into my database is: =IFNA(VLOOKUP($A2,INDIRECT("[ratings.xlsx]"&Allhorses[[#Headers],[20200923]]&"!$A:$C"),2,0),"")

What do I do to because I'm only getting errors or false returns.
 

Attachments

  • 2020.11.07-15.35_01.png
    2020.11.07-15.35_01.png
    194.5 KB · Views: 8

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
Hi, please try prepare a data example using add-in specifically for this and it can be found here XL2BB
 
Upvote 0
Bumping this with a little more info:


So my horse racing ratings are coming along, they're finding winners and value runners.

My database table is a large file. In it, I want to find the peak return, average return (they're both done), plus the returns for each of the last 10 returns for each horse.

The table will have a column for each date from 2020/09/23 to as far as it will take me.

One of the main problems I'm getting is because here they have races every day and the horses have spaced runs finding I'm having trouble with blank cells, most are 7 to 14 days apart, some will be months.

The other thing is they're benchmarked ratings, so some horses will return a result above zero, some below. So even filtering out those just above zero won't work.

The formula I'm using to find the last result is:
=(INDEX('All Horse Ratings.xlsx'!Allhorses[@[20200923]:[20201106]],1,COUNTA($Q2:$BI2))
(I change this in a few cells to get the last 10 results)

The formula I'm using to get the ratings into my database is:
Code:
=(VLOOKUP($A2,INDIRECT("[ratings.xlsx]"&Allhorses[[#Headers],[20200923]]&"!$A:$C"),2,0)

What do I do to because I'm only getting errors or false returns.

Its also a very automatic process. The ratings are worked out in 1 workbook, the results are copied & pasted into a workbook called "ratings" and the database access' those using a mix of vlookup & indirect formulas.
I was just simply copying & pasting into the database, but I was spending about half an hour a day finding all duplicates, writing in the rating in the first free cell, deleting the duplicate and moving on to the next one.
At least with the vlookup all I have to do if highlight the ones already there and mass delete them.

On race day all runners should be returned into the form guide workbook I'm using which is working well.

I've asked on a few places, I've been told pivot tables (that just won't work) been told filter formulas (I've tried and still get a blank or an error).


Has anyone got a way to fix this?

I've uploaded a sample of the spreadsheet

 
Upvote 0
Are you trying to get the header row value for the last column with data per row?
 
Upvote 0
Yes.

So the data/value of horse A's last run which could be on the 5th, horse b's last run which could have been on the 1st.

hopefully I'm explaining it right
 
Upvote 0
Maybe in D2 filled down
Excel Formula:
=LOOKUP(2,1/(Q2:BK2<>""),$Q$1:$BK$1)
 
Upvote 0
Solution
Maybe in D2 filled down
Excel Formula:
=LOOKUP(2,1/(Q2:BK2<>""),$Q$1:$BK$1)
THANK YOU THAT WORKED

For about 2 weeks I've been trying to get it working, I changed the way they were being used because I was getting so many double ups, this has fixed it.
 
Upvote 0
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,923
Messages
6,122,289
Members
449,077
Latest member
Rkmenon

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