refrencing problem

johngio

Board Regular
Joined
Jan 28, 2005
Messages
174
I'm trying to get some row numbers so I may run a countif function. However, I am getting a #N/A error.

My formula is:

=(MATCH(INDEX(N3,1,1),'Sheet2'!A2:A10000, 0))+1

cell N3 is a reference to another cell (=A6; A6 = =DATE(YEAR(C2),MONTH(C2),DAY(1)))

'Sheet2'!A2:A10000 is a whole bunch of dates, once again referenced from another sheet (e.g. 'Sheet2'!A2 = 'Raw data'!A2)

I figure my referencing in my MATCH formula.

Any ideas ? ?

Thanks
 

Some videos you may like

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.

acw

MrExcel MVP
Joined
Feb 13, 2004
Messages
4,814
Hi

Worked for me. Do you have data in sheet2 that actually matches? If there is no match, you will get the error.


Tony
 

johngio

Board Regular
Joined
Jan 28, 2005
Messages
174
mustbe a problem with my referencing to sheet 2
when i enter the date manually in sheet 2 the formula works, but it won't recognise it normally (because the dates in sheet2 are referenced from another sheet. E.g. cell A500 will contain =sheet3 A500

Hmmm. . ...
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
johngio said:
I'm trying to get some row numbers so I may run a countif function. However, I am getting a #N/A error.

My formula is:

=(MATCH(INDEX(N3,1,1),'Sheet2'!A2:A10000, 0))+1

cell N3 is a reference to another cell (=A6; A6 = =DATE(YEAR(C2),MONTH(C2),DAY(1)))

'Sheet2'!A2:A10000 is a whole bunch of dates, once again referenced from another sheet (e.g. 'Sheet2'!A2 = 'Raw data'!A2)

I figure my referencing in my MATCH formula.

Any ideas ? ?

Thanks

Since N3 is a single-cell range, I don't see why you're wrapping it inside an INDEX.
 

johngio

Board Regular
Joined
Jan 28, 2005
Messages
174

ADVERTISEMENT

My bad..

The formula is actually :

=(MATCH(N3,'Sheet2'!A2:A10000, 0))+1

ignore that index from before
 

Aladin Akyurek

MrExcel MVP
Joined
Feb 14, 2002
Messages
85,201
johngio said:
My bad..

The formula is actually :

=(MATCH(N3,'Sheet2'!A2:A10000, 0))+1

ignore that index from before

If you're getting #N/A while you shouldn't, then there is mismatch between the data type of the value in N3 and the data type of the values in 'Sheet2'!A2:A10000.
 

johngio

Board Regular
Joined
Jan 28, 2005
Messages
174
got it; yeh there were times in next to the dates that i didn't see and didn't come up when i displayed the cell value (not my spreadsheet). That was adding a couple of decimals onto the date, and hence I couldn't get an exact match. So I changed the formula (0 changed to 1):

=(MATCH(N3,'Sheet2'!A2:A10000, 1))+1

woohoo!!
 

Watch MrExcel Video

Forum statistics

Threads
1,122,646
Messages
5,597,352
Members
414,138
Latest member
Ankitjainkaka

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
Top