Multiple =IF Function

%3CLINGO-SUB%20id%3D%22lingo-sub-1855664%22%20slang%3D%22en-US%22%3EMultiple%20%3DIF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1855664%22%20slang%3D%22en-US%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Community%20Excel%20Screen%20Shot.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F231570i8B04331059718579%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Community%20Excel%20Screen%20Shot.png%22%20alt%3D%22Community%20Excel%20Screen%20Shot.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%E2%80%83%3C%2FP%3E%3CP%3EDear%20Community%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%2C%20I%E2%80%99m%20rather%20new%20to%20Excel%20and%20have%20no%20programming%20background.%26nbsp%3B%20Maybe%20I%E2%80%99ve%20undertaken%20more%20than%20I%20can%20handle%2C%20but%20I%E2%80%99m%20a%20quick%20learner.%26nbsp%3B%20I%E2%80%99ll%20keep%20this%20a%20short%20as%20possible.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%E2%80%99m%20retired%20and%20volunteered%20to%20measure%20golf%20courses%20via%20GIS%2FGNSS%20satellite%20data%20collection%20(latitudes%2Flongitudes%2Felevations%20in%20decimal%20degrees).%26nbsp%3B%20The%20post-processed%20field%20data%20is%20given%20in%20.csv%20format%20in%20an%20Excel%20spreadsheet.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETo%20facilitate%20building%20a%20final%20Field%20Measurement%20sheet%2C%20I%E2%80%99ve%20taught%20myself%20many%20Excel%20procedures%20to%20transfer%20this%20data%20(e.g.%20how%20to%20catenate%20columns%2C%20employ%20VLOOKUP%20to%20accurately%20populate%20the%20correct%20cells%2C%20etc.)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20very%20last%20step%20before%20I%20start%20to%20populate%20the%20%E2%80%9CGolf%20Measure%20Form%E2%80%9D%20is%20to%20satisfy%20the%20various%20distance%20scenarios%20encountered%20in%20the%20field.%26nbsp%3B%20Each%20Pivot%20Point%20(e.g.%20PP1)%20has%20an%20offset%20distance%20from%20the%20true%20%E2%80%9Cas%20the%20crow%20flies%E2%80%9D%20Tee%20to%20Green%20Center%20(GC)%20distance.%26nbsp%3B%20The%20scenarios%20are%20as%20follows%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CUL%3E%3CLI%3ETee%20to%20GC%20-%20Straight%20point%20to%20point%20distance.%3C%2FLI%3E%3CLI%3ETee%20to%20PP1%20to%20GC%20-%20Three%20points%2C%20two%20distances%20greater%20than%201)%3C%2FLI%3E%3CLI%3ETee%20to%20PP1%20to%20PP2%20to%20GC%20-%20Four%20points%2C%20three%20distances%20greater%20than%202)%3C%2FLI%3E%3CLI%3ETee%20to%20PP1%20to%20PP2%20to%20PP3%20to%20GC%20-%20Five%20points%2C%20four%20distances%20greater%20than%203)%3C%2FLI%3E%3C%2FUL%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20is%20not%20as%20simple%20as%20an%20%3DSUM%20solution%20because%20of%20the%20PP%E2%80%99s%20given%20restraints.%26nbsp%3B%20The%20summation%20%3CSTRONG%3E%3CU%3EMUST%3C%2FU%3E%3C%2FSTRONG%3E%20match%20the%20proper%20scenario%201%2C%202%2C%203%20or%204.%20Any%20given%20golf%20hole%2C%20we%20do%20not%20know%20which%20scenario%20will%20be%20encountered.%20%26nbsp%3BI%20have%20tried%20various%20%3DIF%20strings%20and%20other%20Excel%20formula%20solutions%20to%20capture%20the%20progressive%20logic%20without%20success.%3C%2FP%3E%3CDIV%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1855664%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-1857002%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20%3DIF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1857002%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F858117%22%20target%3D%22_blank%22%3E%40jaulepphotmailcom%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWelcome%2C%20to%20one%20retiree%20from%20another.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFirst%2C%20I%20admire%20your%20enthusiasm%20and%20your%20desire%20to%20learn.%20It's%20hard%2C%20though%2C%20I%20must%20tell%20you%2C%20even%20though%20you've%20done%20a%20yeoman's%20job%20of%20describing%20the%20situation%20and%20provided%20a%20helpful%20image....a%20copy%20of%20your%20actual%20spreadsheet%20would%20give%20us%20here%20(including%20those%20youngsters%20who've%20not%20yet%20retired%2C%20but%20may%20have%20a%20better%20handle%20on%20Excel%20than%20either%20you%20or%20I)...a%20bit%20more%20to%20work%20with%20than%20the%20image%20file%20alone.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20did%20notice%20the%20elaborate%20IF%20function%20you'd%20written%20in%20that%20image....have%20you%20tried%20%3CSTRONG%3EIFS%3C%2FSTRONG%3E%3F%20It%20is%20a%20bit%20easier%20to%20work%20with%20multiple%20conditions%20in%20IFS%2C%20provided%20you%20have%20them%20in%20the%20right%20sequence%20(and%20I%20think%20the%20sequence%20you've%20got%20in%20your%20verbal%20description%20should%20work).%20Here's%20a%20link%20to%20a%20website%20that%20you%20might%20appreciate%20in%20general%20(great%20tutorials%20on%20all%20the%20different%20functions)%2C%20but%20here%20I've%20taken%20you%20directly%20to%20the%20description%20of%20IFS%20and%20how%20to%20use%20it.%20%3CA%20href%3D%22https%3A%2F%2Fexceljet.net%2Fexcel-functions%2Fexcel-ifs-function%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fexceljet.net%2Fexcel-functions%2Fexcel-ifs-function%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1857825%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20%3DIF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1857825%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F858117%22%20target%3D%22_blank%22%3E%40jaulepphotmailcom%3C%2FA%3E%26nbsp%3B%20IF%20I%20understand%20you%20correctly%20I%20think%20you%20just%20want%20to%20use%20MAX()%20function.%26nbsp%3B%20Also%20the%20nested%20IF()%20statement%20has%20both%20logic%20and%20cell%20reference%20errors%20(OR%20I%20don't%20understand%20what%20your%20criteria%20are).%26nbsp%3B%20But%20it%20seems%20to%20me%20you%20want%20the%20distance%20using%205%20points%20only%20if%20that%20is%20%26gt%3B%20using%204%20points%20and%204%20points%20only%20if%20that%20is%20%26gt%3B%203%20points%20and%203%20points%20if%20that%20is%20%26gt%3B%20using%20just%202%20points.%26nbsp%3B%20If%20so%20use%3A%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-excel%22%3E%3CCODE%3E%3DMAX(O58%2C%20Q58%2BO69%2C%20Q58%2BQ69%2BO73%2C%20Q58%2BQ69%2BQ73%2BO77)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1859085%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20%3DIF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1859085%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F425987%22%20target%3D%22_blank%22%3E%40mathetes%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EJust%20got%20home%20after%20a%20long%20day.%26nbsp%3B%20So%20much%20for%20being%20retired.%26nbsp%3B%20Mathetes%2C%20you%20are%20my%20hero!!!%3C%2FP%3E%3CP%3EI%20had%20the%20logic%20correct%2C%20just%20didn't%20know%20enough%20to%20use%20the%20IFS%20formula.%26nbsp%3B%20It%20works%20like%20a%20charm.%3C%2FP%3E%3CP%3EI've%20attached%20a%20screen%20shot%20to%20depict%20your%20solution%2C%20IFS.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20also%20looking%20forward%20to%20try%20the%20MAX%20solution%20as%20proposed%20by%20another%20poster.%3C%2FP%3E%3CP%3EOnce%20again%2C%20thanks!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1861154%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20%3DIF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861154%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F570951%22%20target%3D%22_blank%22%3E%40mtarler%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20are%20correct%20and%20the%20%3DMAX%20function%20is%20more%20concise%20and%20works%20best%20when%20a%20maximum%20value%20is%20required%20for%20an%20%3CU%3Eactive%3C%2FU%3E%20teeing%20ground%20in%20golf.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%20there%20is%20a%20drawback%20to%20utilizing%20this%20function%20in%20place%20of%20the%20%3DIFS%20function.%26nbsp%3B%20At%20any%20given%20golf%20course%2C%20we%20may%20encounter%20different%20scenarios%20(e.g.%20Course%20%231%20has%203%20tees%2C%20Course%20%232%20has%207%20tees%2C%20Course%20%233%20has%205%20tees%2C%20etc.).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOur%20spreadsheet%20provides%20encountering%20up%20to%208%20teeing%20grounds%2C%20although%20the%20normal%20scenario%20is%20between%203-5%20teeing%20grounds.%26nbsp%3B%20Both%20my%20attachments%20utilize%205%20active%20teeing%20grounds%20(e.g.%20Black%2C%20Blue%2C%20White%2C%20Green%2C%20Yellow).%26nbsp%3B%20Tees%206%2C%207%20%26amp%3B%208%20are%20inactive%20and%20need%20to%20depict%20a%20blank%20or%20at%20least%20a%20value%20of%200%20so%20those%20at%20headquarters%20are%20not%20confused%20by%20the%20data%20collected%20in%20the%20field%20if%20they%20see%20a%20value%20(e.g.%20Hole%209's%20inactive%206%2C%207%20%26amp%3B%208%20are%20blank%20as%20they%20should%20be%20and%20Hole%2010's%20inactive%206%2C%207%20%26amp%3B%208%20erroneously%20show%20140%20yards).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMy%20web%20investigations%20indicate%20the%20%3DMAX%20function%20cannot%20supply%20a%20blank%20or%200%20value.%26nbsp%3B%20By%20necessity%2C%20we%20must%20use%20the%20%3DIF%20function%20as%20depicted%20in%20the%20Hole%209%2C%20%3DIF%20Solution%20screen%20shot.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20want%20to%20thank%20you%20for%20your%20thought%2C%20consideration%2C%20alternate%20solution%20and%20reply%20to%20my%20post.%26nbsp%3B%20I'm%20filing%20the%20%3DMAX%20function%20in%20my%20cerebral%20library%20for%20future%20use%20when%20applicable.%26nbsp%3B%20If%20the%20%3DMAX%20function%20can%20be%20utilized%20and%20a%20blank%20cell%20or%20value%20of%200%20can%20be%20depicted%2C%20please%20let%20me%20know.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ERegards%2C%20ProTee%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1861223%22%20slang%3D%22en-US%22%3ERe%3A%20Multiple%20%3DIF%20Function%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1861223%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F858117%22%20target%3D%22_blank%22%3E%40ProTee%3C%2FA%3E%26nbsp%3B%20May%20I%20suggest%20that%20you%20just%20put%20the%20MAX()%20inside%20the%20IF()%20statement.%26nbsp%3B%20As%20you%20noted%2C%20the%20MAX()%20is%20much%20cleaner%20and%20clearer%20to%20read%20than%20the%20multiple%20IF%20conditions.%26nbsp%3B%20So%26nbsp%3B%3C%2FP%3E%3CP%3E%3DIF(%20%5Btee%20to%20hole%5D%20%3D%200%2C%20%22%22%2C%20MAX(...)%20)%3C%2FP%3E%3CP%3EBut%20at%20this%20point%20it%20is%20mainly%20a%20readability%20and%20serviceability%20issue%2C%20not%20functional%20so%20of%20course%20use%20what%20you%20are%20most%20comfortable%20with.%3C%2FP%3E%3CP%3EGlad%20your%20issue%20has%20been%20worked%20out.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

 

Community Excel Screen Shot.png

Dear Community,

 

First, I’m rather new to Excel and have no programming background.  Maybe I’ve undertaken more than I can handle, but I’m a quick learner.  I’ll keep this a short as possible.

 

I’m retired and volunteered to measure golf courses via GIS/GNSS satellite data collection (latitudes/longitudes/elevations in decimal degrees).  The post-processed field data is given in .csv format in an Excel spreadsheet.

 

To facilitate building a final Field Measurement sheet, I’ve taught myself many Excel procedures to transfer this data (e.g. how to catenate columns, employ VLOOKUP to accurately populate the correct cells, etc.)

 

The very last step before I start to populate the “Golf Measure Form” is to satisfy the various distance scenarios encountered in the field.  Each Pivot Point (e.g. PP1) has an offset distance from the true “as the crow flies” Tee to Green Center (GC) distance.  The scenarios are as follows:

 

  • Tee to GC - Straight point to point distance.
  • Tee to PP1 to GC - Three points, two distances greater than 1)
  • Tee to PP1 to PP2 to GC - Four points, three distances greater than 2)
  • Tee to PP1 to PP2 to PP3 to GC - Five points, four distances greater than 3)

 

It is not as simple as an =SUM solution because of the PP’s given restraints.  The summation MUST match the proper scenario 1, 2, 3 or 4. Any given golf hole, we do not know which scenario will be encountered.  I have tried various =IF strings and other Excel formula solutions to capture the progressive logic without success.

 

 

 

7 Replies
Highlighted

@ProTee 

 

Welcome, to one retiree from another.

 

First, I admire your enthusiasm and your desire to learn. It's hard, though, I must tell you, even though you've done a yeoman's job of describing the situation and provided a helpful image....a copy of your actual spreadsheet would give us here (including those youngsters who've not yet retired, but may have a better handle on Excel than either you or I)...a bit more to work with than the image file alone.

 

I did notice the elaborate IF function you'd written in that image....have you tried IFS? It is a bit easier to work with multiple conditions in IFS, provided you have them in the right sequence (and I think the sequence you've got in your verbal description should work). Here's a link to a website that you might appreciate in general (great tutorials on all the different functions), but here I've taken you directly to the description of IFS and how to use it. https://exceljet.net/excel-functions/excel-ifs-function

 

Highlighted

@ProTee  IF I understand you correctly I think you just want to use MAX() function.  Also the nested IF() statement has both logic and cell reference errors (OR I don't understand what your criteria are).  But it seems to me you want the distance using 5 points only if that is > using 4 points and 4 points only if that is > 3 points and 3 points if that is > using just 2 points.  If so use:

=MAX(O58, Q58+O69, Q58+Q69+O73, Q58+Q69+Q73+O77)
Highlighted

@mathetes 

Just got home after a long day.  So much for being retired.  Mathetes, you are my hero!!!

I had the logic correct, just didn't know enough to use the IFS formula.  It works like a charm.

I've attached a screen shot to depict your solution, IFS.

 

I am also looking forward to try the MAX solution as proposed by another poster.

Once again, thanks!

Highlighted

@mtarler 

 

You are correct and the =MAX function is more concise and works best when a maximum value is required for an active teeing ground in golf.

 

Unfortunately there is a drawback to utilizing this function in place of the =IFS function.  At any given golf course, we may encounter different scenarios (e.g. Course #1 has 3 tees, Course #2 has 7 tees, Course #3 has 5 tees, etc.).

 

Our spreadsheet provides encountering up to 8 teeing grounds, although the normal scenario is between 3-5 teeing grounds.  Both my attachments utilize 5 active teeing grounds (e.g. Black, Blue, White, Green, Yellow).  Tees 6, 7 & 8 are inactive and need to depict a blank or at least a value of 0 so those at headquarters are not confused by the data collected in the field if they see a value (e.g. Hole 9's inactive 6, 7 & 8 are blank as they should be and Hole 10's inactive 6, 7 & 8 erroneously show 140 yards).

 

My web investigations indicate the =MAX function cannot supply a blank or 0 value.  By necessity, we must use the =IF function as depicted in the Hole 9, =IF Solution screen shot.

 

I want to thank you for your thought, consideration, alternate solution and reply to my post.  I'm filing the =MAX function in my cerebral library for future use when applicable.  If the =MAX function can be utilized and a blank cell or value of 0 can be depicted, please let me know.

 

Regards, ProTee

Highlighted

@ProTee  May I suggest that you just put the MAX() inside the IF() statement.  As you noted, the MAX() is much cleaner and clearer to read than the multiple IF conditions.  So 

=IF( [tee to hole] = 0, "", MAX(...) )

But at this point it is mainly a readability and serviceability issue, not functional so of course use what you are most comfortable with.

Glad your issue has been worked out.

Highlighted

@mtarler 

 

Thank you @mtarler .  Will try later tonight.  And yes, it is my preference because it's more simple, direct and cleaner looking.

Highlighted

@mtarler 

With your & @mathetes help, our spreadsheet is working great!  Want to thank you both for the assistance and problem solving.