Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Dieter Pfenning

    (@winball)

    Hi Thomas,

    it seems to me that this is an Excel related topic, but anyhow i will try to explain.

    The question is how to handle Excel results where you do not exactly know the row in which your field will be. I will explain it using my Excel sample “gift-certificate.xlsx” file coming with the plugin. When i submit my sample form i will receive an Excel file where the second tab “WP40-GF2Excel” which contains the form inputs looks like:

    .	Column A		Column B		Column C
    Line 1 – 19 …
    Line 20	Email Address		[email protected]	5
    Line 21	Gift Description	A piece of software	2
    Line 22	Recipient Name		A WordPress User	3
    Line 23	Sender Name		winball.de		4

    In the first tab “Gift Certificate” the field C7 contains the formula:

    ='WP40-GF2Excel'!B21

    to get the form input which should describe the gift (Gift Description). If the line 21 does not contain this info our form will show wrong data.

    To be independent from the line number but still get the right data we can use the Excel function VLOOKUP. So i replace the formula in field C7 (in tab “Gift Certificate”) with:

    =VLOOKUP("Gift Description"; A1:B23; 2)

    In my example i get “A piece of software” again as the result, but now i am independent from the row number.

    I hope you can handle your data now.

    Best wishes

    Plugin Author Dieter Pfenning

    (@winball)

    Sorry, there is something missing in the second Excel formula it should look like:

    =VLOOKUP("Gift Description"; 'WP40-GF2Excel'!A1:B23; 2)

    Thread Starter Thomas

    (@enungman)

    Nice!
    Although i cant replicate that when there’s a “space” in the name.. :/
    “A piece of software” gives me an error.. If i change to just “Software” it works.. strange, but i’ll keep working on this ??

    Plugin Author Dieter Pfenning

    (@winball)

    Hi Thomas,

    there are plenty of reasons for errors using VLOOKUP. Because i did not use the fourth parameter of VLOOKUP it is looking for similar written matches, a bit like the “like” in SQL.

    I mark this thread as resolved, because the main question was solved.

    Best wishes

    Dieter

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Blank fields not sent’ is closed to new replies.