Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8127001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:21:47+00:00 2026-06-06T07:21:47+00:00

I have an algorithm that finds a value in a cell, for this case

  • 0

I have an algorithm that finds a value in a cell, for this case lets say that cell is C10. I need to look next to that in column D for a value, and if that value doesnt match what i need, to go up one cell from that and check for a match, etc. I have this so far:

bits = [] 

for row in ws.iter_rows(row_offset=4,column_offset=3):
    #skip over empty rows
    if row:
        #current cell is in column C
        cell = row[2]
        try:
            #find the lowest address in the excel sheet
            if cell.internal_value == min(address):
                #somehow match up in column d
                for '''loop and search col D''':
                    if str(row[3].internal_value).upper == ('CONTROL 1' or 'CON 1'):
                        #add bits
                        for cell in row[4:]:
                            bits.append(cell.internal_value)    
        #pass over cells that aren't a number, ie values that will never match an address
        except ValueError:
            pass
        except TypeError:
            pass

Is there a way to do this? I know the comparison using row[3] compares in column D, but if it isnt correct the first time, i dont know how to go up the column. Or in other words, changing the value in row[value] moves around the row, and I need to know what value/how to move around the column.

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:21:48+00:00Added an answer on June 6, 2026 at 7:21 am
    bits = []
    min_address = False
    for row in ws.iter_rows(row_offset=4,column_offset=3):
        c = row[2]
        d = row[3]
        if not d.internal_value: #d will always have a value if the row isn't blank
            if min_address: 
                break #bits is what you want it to be now
            bits = [] #reset bits every time we hit a new row
            continue #this will just skip to next row
    
        for bits_cell in row[4:]:
            if bits_cell.internal_value:
                bits.append(bits_cell.internal_value)
        if c.internal_value:
            if c.internal_value == min(address):
                min_address = True #we set it to true, then kept going until blank row
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this algorithm that I want to implement on VB6. Sub Main() dim
this is my algorithm that I have written it with my friends (which are
I have to write an algorithm that find the path in DAG with single
I have an algorithm that recursively makes change in the following manner: public static
I have simple algorithm that clean the whitespace from half string until end. Here
If I have an algorithm that takes n log n steps (e.g. heapsort), where
I have a relatively simple algorithm that walks an std::vector looking for two neighbouring
We have our own data streaming algorithm that include some metadata+records+fields values. Currently we
I have a SP that has the following algorithm. IF <SomeCondition> BEGIN SELECT *
I have an assignment that wants me to write an ternary search algorithm and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.