+ Reply to Thread
Results 1 to 34 of 34

IF/AND Formula in Multiple Tabs

  1. #1
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    IF/AND Formula in Multiple Tabs

    Does anyone know if it's even possible to create an IF/AND formula that draws data from multiple tabs?

    For example,

    (assume there are tabs named exactly the same as each of the data entries in column A)

    IF A2 = "ARI" then D2 = ARI!H3. Is this possible?
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: IF/AND Formula in Multiple Tabs

    Hi,

    What is the logic for ATL,BAL, BOS.etc, do you just required Address(ARI!H3) in D2 or the Value of ARI!H3.

    Punnam

  3. #3
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Let's say the value of A2 = "ARI". I would like to display =ARI!H3. But let's say I change the value of A2 = "ATL". I would like to display =ATL!H3.

  4. #4
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: IF/AND Formula in Multiple Tabs

    Hi,

    The work i have done has no logic , but as per u r requirement i have provided it.


    Punnam
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    I'm not sure how to use that formula to do what I asked. I entered it in my spreadsheet and nothing happened.

  6. #6
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: IF/AND Formula in Multiple Tabs

    Hi,

    I have used a & , even u can try CONCATENATE formula to achieve this but only one thing at the place of 3, use ROW()+1,

    Punnam

  7. #7
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Let's try this.

    In this example:
    A2 = "ari" then D2 = "=ari!D1"
    A3 = "atl" then D3 = "=atlD1"


    Is there a formula I can put in D2 & D3 that will automatically switch their values if I switch A2 & A3?

    So,

    A2 = "atl" then D2 = "=atl!D1"
    A3 = "ari" then D3 = "=ari!D1"
    Attached Files Attached Files

  8. #8
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    Like this...

    =INDIRECT(A2&"!D1")
    Biff
    Microsoft MVP Excel
    Keep It Simple Stupid

    Let's Go Pens. We Want The Cup.

  9. #9
    Forum Expert
    Join Date
    03-28-2014
    Location
    Hyderabad,India
    MS-Off Ver
    Excel 2013
    Posts
    1,887

    Re: IF/AND Formula in Multiple Tabs

    Hi Quibility,

    I am unable to analyze you are requirement, many things are possible with excel, as per your latest thread we can make use of Indirect, address, lookup,Vlookup, Index, Match and many other function which will help in transfer data from one sheet to another. Provide the real raw data i can help you.

    Punnam

  10. #10
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Tony, that's perfect. Do you think you could help me take this equation a whole lot further?

    Could you write a formula that incorporates A1, A2, B2, & C2?

    A1 would determine the value in column "A" in each tab in which the data would represent (A1-1)
    A2 would determine the tab in which the data came from
    B2 & C2 would determine the columns in which the data would come from
    IF B2=H & C2=W then display N3, O3, P3, Q3, R3, S3 in D2, E2, F2, G2, H2, I2
    IF B2=H & C2=<>W then display Z3, AA3, AB3, AC3, AD3, AE3 in D2, E2, F2, G2, H2, I2
    IF B2=@ & C2=W then display T3, U3, V3, W3, X3, Y3 in D2, E2, F2, G2, H2, I2
    IF B2=@ & C2=<>W then display H3, I3, J3, K3, L3, M3 in D2, E2, F2, G2, H2, I2


    If that's not clear, here's an example:

    In the attached file A1=7, A2=ATL, B2=H, & C2=W. So the formula I'm looking for would find the data in tab "ATL" (A2), row 17 (A1-1; 7-1=6, so row 17 because A17 = 6), and display columns N17, O17, P17, Q17, R17, & S17 because B2=H and C2=W.

    I hope that is clear! I know it's a lot, but this would be a HUGE help!
    Attached Files Attached Files

  11. #11
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    Sorry, but your file is too big for me.

    I have a 50kb download limit.

  12. #12
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    This should work.
    Attached Files Attached Files

  13. #13
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    display columns N17, O17, P17, Q17, R17, & S17 because B2=H and C2=W
    How do columns N17, O17, P17, Q17, R17, & S17 relate to B2=H and C2=W?

    The column headers are:

    N + O + P
    W→W H

    Q + R + S
    W→L H

  14. #14
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    B2's "H" tells me I'm looking for data that falls under the headers that have an "H" (i.e. W→W H, W→L H, L→W H, & L→L H). C2's "W" tells me I'm looking for data that falls under the headers that have a "W" to left of the arrow (W→W H, W→L H, W→W @, & W→L @). Combined (B2=H and C2=W), means I'm looking specifically for the overlapping data (W→W H & W→L H) under the header .

  15. #15
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs



    I'm looking specifically for the overlapping data (W→W H & W→L H) under the header .
    I'm sure those column headers mean something to you but they make no sense to me.

    I don't see how:

    B2: H
    C2: W

    Relates to: W→W H & W→L H

    If B2=H and C2=W what logical statement would you use to relate those cells to the column headers W→W H & W→L H?

    I can see a vague relationship with W→W H since it contains both H & W.

  16. #16
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Oh, OK. I understand. Think of
    1) L→W @ & L→L @,
    2) W→W H & W→L H,
    3) W→W @ & W→L @,
    4) L→W H & L→L H

    as 4 different headers. The six cells under each header are the desired formula results.

    So, one of four combinations of B2 & C2 will determine which six cells are displayed.

    B2: H, C2: W means looking for the data under header W→W H & W→L H,
    B2: H, C2: L means looking for the data under header L→W H & L→L H,
    B2: @, C2:W means looking for the data under header W→W @ & W→L @,
    B2: @, C2: L means looking for the data under header L→W @ & L→L @.

  17. #17
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    Are there only those 4 possible combinations or are there more?

  18. #18
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    There are only 4 possible combinations. The end result of the formula is to display 1 of 4 possible strings of data (6-consucutive cells ).

    N3, O3, P3, Q3, R3, S3
    Z3, AA3, AB3, AC3, AD3, AE3
    T3, U3, V3, W3, X3, Y3 or
    H3, I3, J3, K3, L3, M3



    Which 6-consecutive cells are displayed is determined by A1, A2, B2, & C2.

    A1 would determine the value in column "A" (the row) in each tab in which the data would represent (A1-1)
    A2 would determine the tab in which the data came from
    B2 & C2 would determine which one of the four 6-consecutive cells is displayed.

    B2: H, C2: W means looking for the data under header W→W H & W→L H (N3, O3, P3, Q3, R3, S3)
    B2: H, C2: L means looking for the data under header L→W H & L→L H (Z3, AA3, AB3, AC3, AD3, AE3)
    B2: @, C2:W means looking for the data under header W→W @ & W→L @ (T3, U3, V3, W3, X3, Y3)
    B2: @, C2: L means looking for the data under header L→W @ & L→L @ (H3, I3, J3, K3, L3, M3)

  19. #19
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    If you look at the example, you'll see that there are 30 entries in "Sheet1" in column "A". The idea is to copy paste the formula from D2:I2 all the way down to D31:I31 so each value in column "A" will produce the 1 of 4 6-consecutive cells based upon each row's data.

    So for A3's data: the cells determining which 6-consecutive cells are displayed are A1 (row), A3 (tab),B3, & C3 (columns).
    And for A4's data: the cells determining which 6-consecutive cells are displayed are A1 (row), A4 (tab),B4, & C4 (columns).
    So on until A31's data: the cells determining which 6-consecutive cells are displayed are A1 (row), A31 (tab),B31 & C31 (columns).

  20. #20
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    OK, what about where some of the cells are empty:

    Data Range
    A
    B
    C
    1
    7
    2
    ATL
    H
    W
    3
    ARI
    @
    L
    4
    BAL
    H
    W
    5
    BOS
    @
    6
    CHC
    H
    7
    CHW
    @
    W
    8
    CIN
    H
    9
    CLE
    @
    W
    10
    COL
    H
    11
    DET
    @
    12
    HOU
    H
    W
    13
    KC
    @
    W


    You must really be into baseball!

  21. #21
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    I AM really into baseball!


    OH, excuse me. I made a typo in my posts where I list "L" as a possible value of C2. It should read

    IF B2=H & C2=W
    IF B2=H & C2=<>W
    IF B2=@ & C2=W
    IF B2=@ & C2=<>W

    I COULD put an "L" in C2.... it doesn't matter. Either C2=L or C2=<>W is the same thing.

  22. #22
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    Quote Originally Posted by quibilty View Post
    I AM really into baseball!
    I'm in Pittsburgh so I'm not really excited about baseball!

    Used to be but not since the early 90's.

    I'm getting ready to break for dinner. I'll have a solution for this later this evening.

  23. #23
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    That's insane that you can do this! I wish I knew how to write these types of formulas!

  24. #24
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    OK, this seems to work although I could only test it on the 2 team sheets in the sample file.

    Kind of long and ugly!

    Data Range
    A
    B
    C
    D
    E
    F
    G
    H
    I
    1
    7
    2
    ATL
    H
    W
    2
    2.5
    0.8
    2
    3
    0.666667
    3
    ARI
    @
    L
    2
    2
    1
    2
    2
    1


    This formula entered in D2:

    =VLOOKUP($A$1-1,INDIRECT($A2&"!A:AE"),IF(AND($B2="H",$C2="W"),COLUMNS($D2:D2)+13,IF(AND($B2="H",$C2<>"W"),COLUMNS($D2:D2)+25,IF(AND($B2="@",$C2="W"),COLUMNS($D2:D2)+19,IF(AND($B2="@",$C2<>"W"),COLUMNS($D2:D2)+7)))),0)

    Copy across to I2 then down as needed.

    It looks like you're going to need a lot of these formulas. They are fairly calculation intensive and if you use enough of them they could cause your file to "slow down".

  25. #25
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    That's right! Wow. Just, wow. I don't know if computing that formula was difficult, but I am thoroughly impressed.

    Now, I don't want to push my luck, but I was hoping you could help me improve this a bit...?


    Keeping the formulas in D2:I2 (they stay the same), pretend the cells in B2 and C2 were empty. Could you write a formula for B2, C2 and J2 so that:


    B2 = column "C" data in team tab (in the example B2 would = C17 because row 17 is determined by A1 (A1=6), this time it's just A1, and not A1-1) THE ONLY "catch" with B2 is that in column "C" (in the team tabs) there's only "@" and "0", "0" would have to = "H" in order for D2:I2 formula to work, or I guess the formula in D2:I2 could just be modified to change "H" to "0".... either way
    C2 = column "F" data in team tab (in the example C2 would = F17 because row 17 is determined by A1 (A1=6), this time it's just A1, and not A1-1)
    J2 = column "G" data in team tab (in the example J2 would = G17 because row 17 is determined by A1 (A1=6), this time it's just A1, and not A1-1)
    A2 is the only information that would be entered manually and it would tell the formulas in B2, C2, D2:I2, & J2 which tab the information can be found


    So, the end result would be the manual entering of two cells: A1 & A2 and then automatically cells B2:J2 would generate based upon only those two cells. I feel like this would be a no brainer after that last formula!

  26. #26
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    Try these...

    B2: =VLOOKUP(A$1,INDIRECT(A2&"!A:C"),3,0)

    C2: =VLOOKUP(A$1,INDIRECT(A2&"!A:F"),6,0)

    J2: =VLOOKUP(A$1,INDIRECT(A2&"!A:G"),7,0)

  27. #27
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Tony, you really are a forum guru! I can't thank you enough.

  28. #28
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Oh, wait. I found ONE hiccup. When C2's formula returns a "W" the formulas in D2:I2 don't register it, thus the formulas in D2:I2 treat the value in C2 as "<>W". Any ideas?

  29. #29
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Wait... nevermind... the problem could be in how I'm copying/pasting...

  30. #30
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    Yep, that was it.

  31. #31
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    Good deal. Thanks for the feedback!

  32. #32
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    One LAST question. (I know I sound like Columbo, but for real this time)!

    When I copy/paste the D2:I2 formulas to cells to the right, the formula doesn't work properly. I have to individually copy paste each formula from D2:I2 and then copy/paste down again. Is there a way to just copy/paste those formulas to the right without individually copying/pasting?

  33. #33
    Forum Contributor
    Join Date
    08-25-2013
    Location
    Virginia, USA
    MS-Off Ver
    Excel 2013
    Posts
    205

    Re: IF/AND Formula in Multiple Tabs

    You know what? Nevermind. I got it. Thanks.

  34. #34
    Forum Expert Tony Valko's Avatar
    Join Date
    12-31-2011
    Location
    Pittsburgh
    MS-Off Ver
    2002, 2007:2013
    Posts
    18,890

    Re: IF/AND Formula in Multiple Tabs

    The "key" formula is the one entered in D2.

    When you copy it across it's written to increment the cell references based on the number of cells it's copied to.

    So, if you copy across to more than 6 cells the references may not be to whatever data you're looking for.

+ 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. Formula help with multiple tabs
    By f150crewcab in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 10-10-2013, 04:52 PM
  2. Need Help Creating VLOOKUP Formula for Multiple Tabs
    By katybailey in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 02-08-2013, 03:04 PM
  3. Help with a formula referencing multiple tabs
    By CIP in forum Excel General
    Replies: 3
    Last Post: 09-08-2009, 10:11 AM
  4. Array formula help across multiple tabs
    By Fatnslow in forum Excel General
    Replies: 6
    Last Post: 04-06-2009, 01:34 AM
  5. Recursive Formula for Multiple Tabs
    By zeph2323 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 10-27-2008, 10:48 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