Excel 2010: COUNTIF issue

eicherj

New Member
Joined
Jul 23, 2010
Messages
5
Greetings from the Land of Lincoln!

I have a 47x16 table (column and row headings included) in which every cell has data, but data is not visible in all cells. This is because of a VLOOKUP statement I am using:

Columns!P2
=IF(ISNA(VLOOKUP($A2,Tables!O$1:O$20,1,FALSE)),"",VLOOKUP($A2,Tables!O$1:O$20,1,FALSE))

<tbody>
</tbody>

(no spaces between "")

My workbook has 2 sheets, Tables! and Columns! and Columns! is the current sheet.

The translation of my equation is: Take the text in Columns!A2 and look in Tables!O2:O20. If it is not found. insert "" in Columns!P2. If the value in Columns!A2 is found in Tables!O2:O20, then insert it into Columns!P2.

Believe it or not, this formula does what I need it to do in all 690 cells (excluding column and row headings).

So much for the set-up. Here's the question:

How do I count the number of columns in each row where there is visible data?

=COUNTIF(B2:P2,"<>""") should return an answer of 1 but instead it returns 15. I've tried so many variations of this statement I can't see straight anymore.

Thanks for your help,

eicherj
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
What sort of data is your VLOOKUP formula returning? For text values try this formula

=COUNTIF(B2:P2,"?*")

.....but that won't work for numbers so for numbers perhaps

=COUNT(B2:P2)

.....or for any of the above or a mixture

=SUMPRODUCT((B2:P2<>"")+0)
 
Upvote 0
Also could't your formula in P2 be shortened to =IF(ISNA(VLOOKUP($A2,Tables!O$1:O$20,1,FALSE)),"",$A2)
 
Upvote 0

Forum statistics

Threads
1,215,038
Messages
6,122,798
Members
449,095
Latest member
m_smith_solihull

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