+ Reply to Thread
Results 1 to 7 of 7

Adding 2 columns of data with if condition

  1. #1
    Registered User
    Join Date
    12-16-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    15

    Adding 2 columns of data with if condition

    Hi all,

    I have been facing some problem. The sample data is attached with this post. I did the codes for adding of column B & E with the header of "FSI/Non-FSI" and "Branch" respectively, under the macro name "sbInsertingColumns".

    After running the macro to add the two columns, i want the data to be filled in with the conditions of:
    FSI/Non-FSI (column B):

    if "Country" = "Singapore" then under the FSI/Non-FSI column B, it will display "Non-FSI", else if country is not "Singapore", it will display "FSI".

    Branch (column E):

    if "Country" = "Singapore" then under the Branch column E, it will display "Local", else if country is not "Singapore", it will display "Oversea".

    I hope to hear from you guys and I appreciate any help from anyone out there. Thank you
    Attached Files Attached Files

  2. #2
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Adding 2 columns of data with if condition

    try add 2 lines
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    12-16-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    15

    Re: Adding 2 columns of data with if condition

    Hi Jindon,

    Thank you so much for your help. And yes, is working fine now.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Adding 2 columns of data with if condition

    You are welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  5. #5
    Registered User
    Join Date
    12-16-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    15

    Re: Adding 2 columns of data with if condition

    Quote Originally Posted by jindon View Post
    You are welcome.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Hi Jindon, I try it out on my another excel data and change the code abit and only managed to run the marco so that it can show the branch. Can you help me with the FSI/NonFSI code.
    Attached Files Attached Files

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,516

    Re: Adding 2 columns of data with if condition

    Change "e" to "j"
    to
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-16-2017
    Location
    Singapore
    MS-Off Ver
    2016
    Posts
    15

    Re: Adding 2 columns of data with if condition

    Thank you so much!

+ 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. Summarising Data – adding totals if condition met
    By pauldaddyadams in forum Excel General
    Replies: 8
    Last Post: 04-12-2015, 10:39 AM
  2. Replies: 0
    Last Post: 11-21-2014, 05:00 PM
  3. Macro to format data - counting and adding additional rows on condition
    By rynofrowan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-12-2013, 11:46 PM
  4. [SOLVED] Conditional Format - adding several data cells for one condition
    By JerBear in forum Excel - New Users/Basics
    Replies: 5
    Last Post: 05-01-2013, 09:47 AM
  5. Adding a condition to a formula to filter data
    By MartinHK in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 04-16-2013, 03:53 PM
  6. Adding Values in two Columns based on condition
    By kaushal99 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-14-2012, 05:52 PM
  7. Adding data to another table in database based on condition
    By chrisjack001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-03-2010, 05:17 PM

Tags for this Thread

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