Solved

COUNTIF Return 3.1 not 3.10

Posted on 2011-09-22
6
347 Views
Last Modified: 2012-08-14
Here is my problem.

I am trying to make a spreadsheet that is going to be imported by another program.  And I need to have the formula keep count of the number of times something has been selected above.

Here is what I am doing.  I am using a VLOOKUP to find the Value Column.  Then I am using a COUNTIF to Total # of time occurances in the column.  
Then using  CONCATENATE to Produce Value Displayed
Group                                 Value           Total #         Correct Value              Value Displayed
Plate-Carbon        3.1      1                 1                                    3.1.1
Plate-Carbon       3.1      2                  2                                   3.1.2
MISC.                           3.10               3                 1                                    3.10.1


The Issue I am having is that COUNTIF is counting 3.10 as 3.1
I can't change the the number to be decimial based because I need 3.1 and 3.10.

0
Comment
Question by:RyanReese
  • 3
  • 2
6 Comments
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 36580815
RyanReese,

It would be useful to see some sample data and/or a sample file.  EE now allows you to directly upload files to your question.

The sample file should clearly illustrate both the input and the expected output given that input.  The sample file need not be very large, but it should have enough examples to cover the expected range of values/scenarios.

Please be advised that once you upload a file, it can be publicly accessed, and that it may not be possible to fully and permanently delete it.  The file may also be indexed by the major search engines.

Therefore, be very careful about posting proprietary, confidential, or other sensitive information.  If necessary, use "fake" and/or obfuscated data in your sample.

Please note that at present EE restricts uploads to certain file types.  If your file type does not match those in the list, you can use http://www.ee-stuff.com instead, which is not officially an EE site, but is run by people connected to EE.

Patrick
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36580850
Typically COUNTIF treats text and numbers the same so 3.10 = 3.1 even if the former is text. Assuming your data is text (which it will be if produced by concatenation) then try SUMPRODUCT instead e.g. to count 3.10 in B2:B10

=SUMPRODUCT((B2:B10="3.10")+0)
0
 

Author Comment

by:RyanReese
ID: 36580979
I can't use 3.10 within the formula since I need to return the total count based on different values in the formula.  

I attached the file that shows the issue

=COUNTIF($J$1:J2,J2)

Plate-Carbon      3.1      1      CYLINDER
Plate-Carbon      3.1      2      HEADS 1&2
MISC.      3.10      3      NOZ A
 Example-Experts.xlsx
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 50

Accepted Solution

by:
barry houdini earned 500 total points
ID: 36581166
The same principle applies with the criterion being a cell reference- try SUMPRODUCT like this

=SUMPRODUCT((B$1:B2=B2)+0)

make sure you format the formula cells as general

regards, barry
0
 
LVL 50

Expert Comment

by:barry houdini
ID: 36581184
...see attached..

regards, barry
27322180.xlsx
0
 

Author Closing Comment

by:RyanReese
ID: 36581272
Thank you.  That was it
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction This Article is a follow-up to my Mappit! Addin Article (http://www.experts-exchange.com/A_2613.html), it was inspired by an email posting I made to EUSPRIG (http://www.eusprig.org/index.htm), I will briefly cover: 1) An overvie…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now