+ Reply to Thread
Results 1 to 5 of 5

How to use HLOOKUP or other command to find a value within a range

  1. #1
    antwash
    Guest

    How to use HLOOKUP or other command to find a value within a range

    Simple question...I am looking for a value within a range of nine cells in a
    row. If the value is not present I would like for the value that is not
    present (false) to be displayed. I tried a nested if statement, but the will
    only work on 7 conditions.

    For example: Take your average Suduko game. In Row1, numbers 1-9 can
    appear in a random order. If I want to know if the number 1 has been entered
    in any of the nine row cells, logically I would say "If the contents within
    B2:B10<>1, display 1" and repeat in the next cell, "If the contents within
    B2:B10<>2,display 2" and so on...up to the number 9. This way the person
    doing the puzzle will know what entries are left.

    B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B15 MISSING
    VALUE
    Row1 6 7 9 2 1 5
    =formula to check for value

    If not present, value is

    displays

  2. #2
    antwash
    Guest

    RE: How to use HLOOKUP or other command to find a value within a range

    Corrected Example...

    B2 B3 B4 B5 B6 B7 B8 B9 B10 B15 MISSING VALUE
    Row1 6 7 9 2 1 5 =formula to
    check for value
    If
    not present, value displays

  3. #3
    Peo Sjoblom
    Guest

    Re: How to use HLOOKUP or other command to find a value within a range

    What do you want to return if the value is present? Nothing?

    =IF(COUNTIF($B$2:$B$10,ROWS($B$1:B1))=0,ROWS($B$1:B1),"")

    copy down

    btw one of the MS Excel developers (Dan Cory) has constructed a Sudoko
    solver using built in functions

    http://office.microsoft.com/en-us/te...809721033.aspx

    another one using code is here (by MVP Andy Pope)

    http://andypope.info/fun/sudoku.htm



    --
    Regards,

    Peo Sjoblom

    (No private emails please)


    "antwash" <[email protected]> wrote in message
    news:[email protected]...
    > Simple question...I am looking for a value within a range of nine cells in
    > a
    > row. If the value is not present I would like for the value that is not
    > present (false) to be displayed. I tried a nested if statement, but the
    > will
    > only work on 7 conditions.
    >
    > For example: Take your average Suduko game. In Row1, numbers 1-9 can
    > appear in a random order. If I want to know if the number 1 has been
    > entered
    > in any of the nine row cells, logically I would say "If the contents
    > within
    > B2:B10<>1, display 1" and repeat in the next cell, "If the contents within
    > B2:B10<>2,display 2" and so on...up to the number 9. This way the person
    > doing the puzzle will know what entries are left.
    >
    > B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B15 MISSING
    > VALUE
    > Row1 6 7 9 2 1 5
    > =formula to check for value
    >
    > If not present, value is
    >
    > displays



  4. #4
    antwash
    Guest

    Re: How to use HLOOKUP or other command to find a value within a r

    Thanks much Peo Sjoblom... That did the trick. The links were good too..
    they helped me better understand the function..

    "Peo Sjoblom" wrote:

    > What do you want to return if the value is present? Nothing?
    >
    > =IF(COUNTIF($B$2:$B$10,ROWS($B$1:B1))=0,ROWS($B$1:B1),"")
    >
    > copy down
    >
    > btw one of the MS Excel developers (Dan Cory) has constructed a Sudoko
    > solver using built in functions
    >
    > http://office.microsoft.com/en-us/te...809721033.aspx
    >
    > another one using code is here (by MVP Andy Pope)
    >
    > http://andypope.info/fun/sudoku.htm
    >
    >
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "antwash" <[email protected]> wrote in message
    > news:[email protected]...
    > > Simple question...I am looking for a value within a range of nine cells in
    > > a
    > > row. If the value is not present I would like for the value that is not
    > > present (false) to be displayed. I tried a nested if statement, but the
    > > will
    > > only work on 7 conditions.
    > >
    > > For example: Take your average Suduko game. In Row1, numbers 1-9 can
    > > appear in a random order. If I want to know if the number 1 has been
    > > entered
    > > in any of the nine row cells, logically I would say "If the contents
    > > within
    > > B2:B10<>1, display 1" and repeat in the next cell, "If the contents within
    > > B2:B10<>2,display 2" and so on...up to the number 9. This way the person
    > > doing the puzzle will know what entries are left.
    > >
    > > B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B15 MISSING
    > > VALUE
    > > Row1 6 7 9 2 1 5
    > > =formula to check for value
    > >
    > > If not present, value is
    > >
    > > displays

    >
    >


  5. #5
    antwash
    Guest

    Re: Solution found based on your reply

    Based on your formula... I was able to figure it out...

    i.e. searching for the number 1 in affected row, showing that it was used
    and displaying the number if it is not used.

    =IF(COUNTIF(B2:J2,1),"Used","1")

    Thanks much for your assistance. This group rocks!

    "Peo Sjoblom" wrote:

    > What do you want to return if the value is present? Nothing?
    >
    > =IF(COUNTIF($B$2:$B$10,ROWS($B$1:B1))=0,ROWS($B$1:B1),"")
    >
    > copy down
    >
    > btw one of the MS Excel developers (Dan Cory) has constructed a Sudoko
    > solver using built in functions
    >
    > http://office.microsoft.com/en-us/te...809721033.aspx
    >
    > another one using code is here (by MVP Andy Pope)
    >
    > http://andypope.info/fun/sudoku.htm
    >
    >
    >
    > --
    > Regards,
    >
    > Peo Sjoblom
    >
    > (No private emails please)
    >
    >
    > "antwash" <[email protected]> wrote in message
    > news:[email protected]...
    > > Simple question...I am looking for a value within a range of nine cells in
    > > a
    > > row. If the value is not present I would like for the value that is not
    > > present (false) to be displayed. I tried a nested if statement, but the
    > > will
    > > only work on 7 conditions.
    > >
    > > For example: Take your average Suduko game. In Row1, numbers 1-9 can
    > > appear in a random order. If I want to know if the number 1 has been
    > > entered
    > > in any of the nine row cells, logically I would say "If the contents
    > > within
    > > B2:B10<>1, display 1" and repeat in the next cell, "If the contents within
    > > B2:B10<>2,display 2" and so on...up to the number 9. This way the person
    > > doing the puzzle will know what entries are left.
    > >
    > > B2 B3 B4 B5 B6 B7 B8 B9 B10 B11 B15 MISSING
    > > VALUE
    > > Row1 6 7 9 2 1 5
    > > =formula to check for value
    > >
    > > If not present, value is
    > >
    > > displays

    >
    >


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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