+ Reply to Thread
Results 1 to 5 of 5

Set value to odds or evens and then write inn another cell accordingly.

  1. #1
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Set value to odds or evens and then write inn another cell accordingly.

    Screenshot 2022-08-01 100937.png

    In the picture you can see that there is a name, is it possible to check if the name appears inn odds or evens the check inn/out column is updated with Check In on an odd number and Check Out on an even number in VBA?

    Right now I have typed it in manually to set an examle.



    Thanks in advance
    Last edited by Bartor; 08-01-2022 at 08:39 AM.

  2. #2
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (both in England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2505 (Windows 11 Home 24H2 64-bit)
    Posts
    91,234

    Re: Set value to odds or evens and then write inn another cell accordingly.

    There are instructions at the top of the page explaining how to attach your sample workbook.

    A good sample workbook has just 10-20 rows of representative data that has been desensitised. It also has expected results mocked up, worked examples where required, relevant cells highlighted and a few explanatory notes.

    Just FYI:

    inn = hostelry, place where you might enjoy a beer by a roaring fire or even spend the night
    in = preposition
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help. It's a universal courtesy.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    NB:
    as a Moderator, I never accept friendship requests.
    Forum Rules (updated August 2023): please read them here.

  3. #3
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Set value to odds or evens and then write inn another cell accordingly.

    Yes it is possible a sample as ALi says makes life easier

    the count if function will count the occurrences of the value
    countif(a$2:a2) will do this

    isodd will return a true if this value is odd

    if(isodd(countif(a$2:a2)), "check in", Check out") in cell c2

  4. #4
    Registered User
    Join Date
    07-27-2022
    Location
    Rogaland, Norway
    MS-Off Ver
    365
    Posts
    9

    Re: Set value to odds or evens and then write inn another cell accordingly.

    Thanks, this helped out a lot I ended up with this: =IF(ISBLANK(A2),"",IF(ISODD(COUNTIF($A$2:B2,A2)),"Checked In","Checked Out"))

  5. #5
    Forum Expert
    Join Date
    10-10-2016
    Location
    Sheffield
    MS-Off Ver
    365 and rarely 2016
    Posts
    3,212

    Re: Set value to odds or evens and then write inn another cell accordingly.

    yes that was the final polish with the addition, =IF(A2="","",IF(ISODD(COUNTIF($A$2:B2,A2)),"Checked In","Checked Out"))

    Would also work but the b2 references should be A2 as you will never find the name sin the next column, unless your data formatting isn't entirely consistent

    If you are happy mark the thread as solved

+ 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. Bin Location - Odds and Evens
    By Merchandiser in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-08-2019, 06:52 PM
  2. Converting fractional odds in one cell to decimal
    By chilli76 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 06-08-2016, 04:52 AM
  3. [SOLVED] Transfer Odds From a Cell
    By Purple Rain in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 01-12-2016, 11:52 AM
  4. How to calculate Bookmaker real odds (odds less commission) in Excel 2013 ?
    By sbeekallan in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 04-09-2015, 08:43 AM
  5. Replies: 3
    Last Post: 08-31-2011, 09:11 AM
  6. Rounding, sig figs and the rule of evens
    By skrimpy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-20-2005, 10:24 AM
  7. Rounding, sig figs and the rule of evens-Is there a way to modify
    By skrimpy in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-20-2005, 09:55 AM

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