+ Reply to Thread
Results 1 to 11 of 11

Formula that finds specified numbers in rows only

  1. #1
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Question Formula that finds specified numbers in rows only

    Hi everyone!

    Question.png

    I have attached a visual example of my question. I am trying to find the number of occurrences for two numbers appearing in ROWS only.

    Can anyone assist?

  2. #2
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: Formula that finds specified numbers in rows only

    Many members are unable to see images in the *.png format due to forum compatibility issues with some browsers.

    If you need to post an image post it in the *.jpg format.

    Even better than posting images... post a SMALL sample file. That way we can test solutions directly in the file with the relevant data.
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  3. #3
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Formula that finds specified numbers in rows only

    Try this ...

    =SUMPRODUCT(--(COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:55")),0),"2")
    *COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:55")),0),"3")>0))
    Last edited by Phuocam; 11-05-2016 at 01:16 AM.

  4. #4
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula that finds specified numbers in rows only

    Sorry, Tony. I have attached the file. The number combinations are along the top row.
    runelady2.xlsx

  5. #5
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula that finds specified numbers in rows only

    Hi Phuocam,

    This is very close. It's not picking up on zeros though, such as a 0/0 combo.

  6. #6
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula that finds specified numbers in rows only

    It doesn't seem to calculate them correctly in my sheet.

  7. #7
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Formula that finds specified numbers in rows only

    Sorry, edit ...

    In A2:

    =IF(LEFT(A$1)=RIGHT(A$1),SUMPRODUCT(--(COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),RIGHT(A$1))>1)),
    SUMPRODUCT(--(COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),LEFT(A$1))
    *COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),RIGHT(A$1))>0)))

    Copy cross.
    Attached Files Attached Files
    Last edited by Phuocam; 11-05-2016 at 01:25 AM.

  8. #8
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Formula that finds specified numbers in rows only

    A little shorter ...

    =SUMPRODUCT(--(COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),LEFT(A$1))
    *COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),RIGHT(A$1))>0+(LEFT(A$1)=RIGHT(A$1))))

  9. #9
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,941

    Re: Formula that finds specified numbers in rows only

    a2
    Please Login or Register  to view this content.
    try this and copy towards right
    Last edited by samba_ravi; 11-05-2016 at 08:18 AM.
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  10. #10
    Registered User
    Join Date
    10-14-2016
    Location
    CO
    MS-Off Ver
    2007
    Posts
    17

    Re: Formula that finds specified numbers in rows only

    Quote Originally Posted by Phuocam View Post
    Sorry, edit ...

    In A2:

    =IF(LEFT(A$1)=RIGHT(A$1),SUMPRODUCT(--(COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),RIGHT(A$1))>1)),
    SUMPRODUCT(--(COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),LEFT(A$1))
    *COUNTIF(OFFSET($A$3:$C$3,ROW(INDIRECT("1:313")),0),RIGHT(A$1))>0)))

    Copy cross.
    Thank you, Phuocam. This is perfect.

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2024
    Posts
    6,179

    Re: Formula that finds specified numbers in rows only

    You are welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 3
    Last Post: 11-03-2014, 04:23 PM
  2. [SOLVED] Need Formula That Finds the Max and Min
    By artiststevens in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 04-05-2014, 02:22 AM
  3. [SOLVED] VBA macro issue, finds text not numbers.
    By kokapelly in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-26-2013, 01:37 PM
  4. [SOLVED] Delete Rows based on what it finds?
    By Hyflex in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2013, 04:06 PM
  5. Replies: 1
    Last Post: 02-01-2013, 06:30 PM
  6. Writing a function that finds the numbers that make up a total
    By scotts091 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 02-09-2008, 01:24 PM
  7. Hiding Rows between two Finds
    By SharonInGa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-30-2005, 06:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1