+ Reply to Thread
Results 1 to 7 of 7

Give remarks based on Age calculation

  1. #1
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Give remarks based on Age calculation

    I have data with Name, Date of birth and Age as per format. I need vba code to check the age of the persons.

    Need common Remarks in Column O

    I am using some code but that is giving all desired results. code given at the end of this page

    Criteria is

    if Self OR Spouce OR Father OR Mother OR Father-in-law OR Mother-in-Law (As per Relation mentioned "in Column I) age is less than 18 years (As per age mentioned "in Column K) then need result as "Self age is less than 18 years" OR "Spouce age is less than 18 years" OR “Father age is less than 18 years” and so on in Column O against all family members of particular family code. E.g. Refer column No.O2 to O5.

    if Self OR Spouce OR Father OR Mother OR Father-in-law OR Mother-in-Law (As per Relation mentioned "in Column I) age is above 80 years (As per age mentioned "in Column K) then need result as "Self age is above 80 years" OR "Spouce age is above 80 years" OR “Father age is above 80 years” and so on in Column O against all family members of particular family code. E.g. Refer column No.O24 to O25.

    if any Child (Child, Child2, Child3,…. age is above 25 years (As per age mentioned "in Column K) then need result as "Child age is above 25 years "in Column O. For other child "Child2 age is above 25 years OR Child3 age is above 25 years" E.g. Refer column No.O7 to O10.

    Also Need Some Logical Remarks in Column O


    If age difference between Self and Spouce is more than 15 years then need result as "Self and Spouce age difference is more than 15 years "in Column O.

    If age difference between Self and Child, Child2, Child3….. is less than 18 years then need result as "Self and Child age difference is less than 18 years "in Column O.

    If age difference between Self and Father is less than 18 years then need result as "Self and Father age difference is less than 18 years "in Column O.

    If age difference between Self and Mother is less than 18 years then need result as "Self and Mother age difference is less than 18 years "in Column O.

    If age difference between Self and Father-in-law is less than 18 years then need result as "Self and Father-in-law age difference is less than 18 years "in Column O.

    If age difference between Self and Mother-in-law is less than 18 years then need result as "Self and Mother-in-law age difference is less than 18 years "in Column O.

    If age difference between Spouce and Child, Child2, Child3….. is less than 18 years then need result as "Spouce and Child age difference is less than 18 years "in Column O.

    If age difference between Spouce and Father is less than 15 years then need result as "Spouce and Father age difference is less than 15 years "in Column O.

    If age difference between Spouce and Mother is less than 15 years then need result as "Spouce and Mother age difference is less than 15 years "in Column O.

    If age difference between Spouce and Father-in-law is less than 18 years then need result as "Spouce and Father-in-law age difference is less than 18 years "in Column O.

    If age difference between Spouce and Mother-in-law is less than 18 years then need result as "Spouce and Mother-in-law age difference is less than 18 years "in Column O.

    If any cell in Age (Column I) contains following


    #NUM! Wrong Age Mentioned
    #N/A Wrong Age Mentioned
    #NULL! Wrong Age Mentioned
    #REF! Wrong Age Mentioned
    #DIV/0! Wrong Age Mentioned
    ##### Wrong Age Mentioned
    Errors Wrong Age Mentioned
    OR any kind of error Wrong Age Mentioned

    please note: very important is if there is multiple remarks applicable to any family All the remarks should be there separated by “/” against all members of that particular family. For example refer cell O16 to O20 and cell O26 to O28

    This is very important for me. Please help me with code.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Give remarks based on Age calculation

    I have a quick question that isnt directly linked to your request but will help to determine how the answers work.

    1. How do you identify a "family" as such? at the moment its just a list of Relationships one after the other, they seem to be grouped in colours (which i assume is manual), is it always the case that the records will start with the "Self" item? and therefore that can be used to determine relevant records?

    EDIT: Rows 4 & 5 of the example show an error of "under 18" yet both records are 30? is this just an error in the example or am I missing something?
    Last edited by pjwhitfield; 11-01-2016 at 07:30 AM.
    If someone has helped you then please add to their Reputation

  3. #3
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: Give remarks based on Age calculation

    oops. sorry,

    You can consider family number given in column P.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: Give remarks based on Age calculation

    yes row number 4 and 4 is just an error

  5. #5
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: Give remarks based on Age calculation

    Hey Sorry,

    row Number four and five is not an error.

    It Shows "Self age is less than 18 years"
    Because in that particular family self age is <18 years. Hence it is mentioned against all members of the family.

  6. #6
    Forum Expert
    Join Date
    10-09-2014
    Location
    Newcastle, England
    MS-Off Ver
    2003 & 2013
    Posts
    1,986

    Re: Give remarks based on Age calculation

    How is it possible though to have two "Self" and "Spouse" entries in the same family?

  7. #7
    Forum Contributor
    Join Date
    11-17-2015
    Location
    India
    MS-Off Ver
    2013
    Posts
    365

    Re: Give remarks based on Age calculation

    Dear Sir,
    please find attached revised file for your reference.
    Attached Files Attached Files

+ 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. check 2 parameters and give remarks
    By saravanan1981 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-20-2016, 11:48 AM
  2. [SOLVED] VBA to master check in two column if criteria met give remarks in F
    By johnlara in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2016, 02:25 PM
  3. Value based remarks
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-15-2015, 02:55 PM
  4. [SOLVED] In Remarks Column the Remarks should be as described as the attached excel file
    By robin.das077 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 04-30-2013, 03:38 AM
  5. [SOLVED] Conditional statement calculation based on result of previous calculation.(Need some help)
    By takeprofit in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-01-2012, 01:45 AM
  6. [SOLVED] Macro To Insert Remarks Based On Demand Value
    By cathchin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-27-2012, 11:22 PM
  7. Calculation in a single cell with text remarks
    By blockrocker in forum Excel General
    Replies: 2
    Last Post: 12-21-2010, 09:11 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