+ Reply to Thread
Results 1 to 7 of 7

How to use cell reference to match character string

  1. #1
    Registered User
    Join Date
    05-07-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    4

    How to use cell reference to match character string

    A B C D E
    1 IC609 Mumbai D Mumbai 3
    2 SG208 Bangalore D
    3 9W328 Mumbai 1,3,4,5,6,7
    4 9W654 Mumbai 1,2,3,4,5,6
    5 S2456 Mumbai D
    6 DN716 Delhi D
    7 IC614 Delhi D
    8 IC7267 Hyderabad 1,5


    The data shows the flights from Ahmedabad to various destinations. They are operative on the the weekdays mentioned in Column C. D= Daily, 1=Monday, 7=Sunday. I have to find the no. of flights to particular destination on a particular day. Eg. No. of flights to Mumbai on Tuesday=2.
    I tried using the COUNTIFS function to do that. The formula that I used can take care of a particular day of the week (1,2, or so on) but in general if the day of the week is to be taken as a cell reference, I am not able to do that.
    My formula =COUNTIFS(B1:B8,D1,C1:C8,"*3*")+COUNTIFS(B1:B8,D1,C1:C8,"D"). As it is evident that the formula only works for day 3, it can not use the cell reference of E1 to find the no. of flights on a any particular day given in E1. How to do that?

  2. #2
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: How to use cell reference to match character string

    attach a sample file with desired result
    Samba

    Say thanks to those who have helped you by clicking Add Reputation star.

  3. #3
    Registered User
    Join Date
    05-07-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    4

    Re: How to use cell reference to match character string

    I have attached the problem here.
    Attached Files Attached Files

  4. #4
    Forum Guru samba_ravi's Avatar
    Join Date
    07-26-2011
    Location
    Hyderabad, India
    MS-Off Ver
    Excel 2021
    Posts
    8,911

    Re: How to use cell reference to match character string

    =SUM(INDEX(($B$3:$B$17=$E7)*(($C$3:$C$17="D")+ISNUMBER(SEARCH(3,$C$3:$C$17))),0))
    Try this

  5. #5
    Registered User
    Join Date
    05-07-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    4

    Re: How to use cell reference to match character string

    Thanks.. it worked just had to change one thing i.e. using the cell reference F7 in place of "3" in ISNUMBER(SEARCH(3,$C$3:$C$17))) to incorporate any day in that cell. Anyways, can u please explain the formula as I don't have much idea about the functions that you used.

  6. #6
    Forum Moderator
    Join Date
    01-21-2014
    Location
    St. Joseph, Illinois U.S.A.
    MS-Off Ver
    Office 365 v 2403
    Posts
    13,406

    Re: How to use cell reference to match character string

    One way.....using F7 for the day (as in the upload) is this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    To use E1 use this
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    Put the day number in E1 (or F7 depending).

  7. #7
    Registered User
    Join Date
    05-07-2015
    Location
    India
    MS-Off Ver
    2010
    Posts
    4

    Re: How to use cell reference to match character string

    Thanks.. This one I can understand. I was having problem in using the cell reference to check the day from the array. I was not familiar with the syntax. Thanks a lott.. !!

+ 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. UDF to find character in string and reference another cell
    By SoothSailor in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-28-2014, 08:25 PM
  2. [SOLVED] find the character position in a string of the last occurrence of a nominated character
    By jmac1947 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-04-2014, 11:52 PM
  3. [SOLVED] Calling string inside cell reference to reference another sheet.
    By {=OR(value=array)} in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 12-26-2013, 04:45 PM
  4. [SOLVED] IF/Find formula - Differentiating between two character match and three character match
    By ExcellentM in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-20-2012, 02:16 PM
  5. match duplicate string character
    By subhas in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-26-2009, 02:12 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