IFERROR & VLOOKUP / If Month formula issues

%3CLINGO-SUB%20id%3D%22lingo-sub-1695418%22%20slang%3D%22en-US%22%3EIFERROR%20%26amp%3B%20VLOOKUP%20%2F%20If%20Month%20formula%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1695418%22%20slang%3D%22en-US%22%3E%3CP%3EI%20copied%20and%20paste%202%20formulas%20related%20to%201)%20IFERROR%20and%20VLOOKUP%2C%20and%202)%20IF%2FMonth%20from%20a%20known%20good%20spreadsheet%20into%20a%20new%20spreadsheet%2C%20and%20they%20stopped%20working.%20I%20spent%20hours%20debugging%20then%20and%20found%20no%20success.%20Can%20someone%20provide%20some%20guidance%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIFERROR(VLOOKUP(W2%2C'FOP%20Table'!A%3AD%2C3%2C0)%2C%20IFERROR(VLOOKUP(W2%2C'FOP%20Table'!B%3AD%2C2%2C0)%2C%22TBD%22))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(MONTH(Y2)%26lt%3B%3D3%2CYEAR(Y2)%26amp%3B%22_FQ4%22%2CIF(MONTH(Y2)%26lt%3B%3D6%2C(YEAR(Y2)%2B1)%26amp%3B%22_FQ1%22%2CIF(MONTH(Y2)%26lt%3B%3D9%2C(YEAR(Y2)%2B1)%26amp%3B%22_FQ2%22%2C(YEAR(Y2)%2B1)%26amp%3B%22_FQ3%22)))%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20appreciate%20your%20help.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1695418%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1695522%22%20slang%3D%22en-US%22%3ERe%3A%20IFERROR%20%26amp%3B%20VLOOKUP%20%2F%20If%20Month%20formula%20issues%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1695522%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F802075%22%20target%3D%22_blank%22%3E%40Lee_Koh%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20apply%20General%20format%20(instead%20if%20Text)%20to%20these%20cells%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20266px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F220413i618F91BA891FB3EB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3Eand%20re-enter%20formulas%20(F2%2C%20Enter)%2C%20they%20calculate%20something.%20But%20I'm%20not%20sure%20what%20you'd%20like%20to%20calculate.%20For%20example%2C%20formula%20in%20C2%20refers%20on%20Y2%20as%20on%20date%2C%20but%20that's%20text%20field.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

I copied and paste 2 formulas related to 1) IFERROR and VLOOKUP, and 2) IF/Month from a known good spreadsheet into a new spreadsheet, and they stopped working. I spent hours debugging then and found no success. Can someone provide some guidance?

 

=IFERROR(VLOOKUP(W2,'FOP Table'!A:D,3,0), IFERROR(VLOOKUP(W2,'FOP Table'!B:D,2,0),"TBD"))

 

=IF(MONTH(Y2)<=3,YEAR(Y2)&"_FQ4",IF(MONTH(Y2)<=6,(YEAR(Y2)+1)&"_FQ1",IF(MONTH(Y2)<=9,(YEAR(Y2)+1)&"_FQ2",(YEAR(Y2)+1)&"_FQ3")))

 

I appreciate your help.

7 Replies
Highlighted

@Lee_Koh 

If you apply General format (instead if Text) to these cells

image.png

and re-enter formulas (F2, Enter), they calculate something. But I'm not sure what you'd like to calculate. For example, formula in C2 refers on Y2 as on date, but that's text field.

Highlighted

@Lee_Koh

Cells A2 to C2 are formatted as Text, so they display the formulas as text instead of evaluating them.

Select A2:C2.

Set the number format to General.

Select the cells one by one, press F2 then Enter.

The formulas in A2 and B2 will return a value, but the one in C2 will return #VALUE!. This is because the formula refers to MONTH(Y2) and YEAR(Y2), but Y2 does not contain a date.

Highlighted

Hi @Sergei Baklan,

 

Thank you much for your help. It worked after I followed your instructions. Why would a General Format (instead of text) cause the problem? What does F2/Enter do to the existing formula?

 

Also, The formula in C2 should refer to Q2 (instead of Y2) as on date. Thanks for pointing it out.

 

Lee 

Highlighted

Hi @Hans Vogelaar, thanks so much for your advice. I understand now. 

 

I learnt something today.

Lee 

Highlighted

@Lee_Koh 

If cell is formatted as text, whatever you enter into it will be taken literally as you typed it. Even if such text is in form of date, formula, number - that's just a text.

 

If you format the cell as General when Excel recognizes you enter something else. If this else start from = Excel interprets what was entered as formula.

 

If you press F2 you shift on cell edit mode (you may edit cell content directly within it, not in formula bar). Pressing Enter you finish the editing.

 

Above are main topics, something could be done by another way. 

Highlighted
I got it. thank you foe your help.

Lee
Highlighted

@Lee_Koh , you are welcome