SOLVED

excel IF formula

%3CLINGO-SUB%20id%3D%22lingo-sub-3377034%22%20slang%3D%22en-US%22%3Eexcel%20IF%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3377034%22%20slang%3D%22en-US%22%3E%3CP%3EHello%2C%26nbsp%3B%20I%20have%20a%20commercial%20dive%20school%20and%20am%20creating%20an%20excel%20spreadsheet%20to%20calculate%20dive%20minutes%20and%20allocate%20these%20minutes%20to%20specific%20columns%20which%20represent%20different%20dive%20depth.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20is%20the%20statement%20I%20am%20trying%20to%20create%20in%20excel.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20divers%20depth%20is%20between%200-33%20feet%20then%20the%20depth%20recorded%20in%26nbsp%3B%20G7%20cell%20is%20copied%20to%20j7.%26nbsp%3B%20If%20the%20depth%20is%20between%2033-49.5%20ft%20then%20G7%20is%20copied%20to%20k7.%26nbsp%3B%20If%20the%20depth%20is%20between%2049.5-66%20ft%20then%20G7%20is%20copied%20to%20l7.%26nbsp%3B%20IF%20the%20depth%20is%20between%2066-98%20ft%20then%20G7%20is%20copied%20to%20M7.%26nbsp%3B%20And%20if%20the%20depth%20is%20to%2099%20ft%20then%20G7%20is%20copied%20to%20N7.%26nbsp%3B%20%26nbsp%3B%20Otherwise%20%220%22%20is%20entered%20in%20each%20J7%2C%20K7%2C%20L7%2C%20M7%2C%20N7.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESo%20for%20every%20dive%20one%20of%20the%20cells%20(J7%2C%20K7%2C%20L7%2C%20M7%2C%20N7)%26nbsp%3B%20%26nbsp%3Bwill%20have%20the%20dive%20depth%20that%20was%20recorded%20on%20G7.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EMuch%20appreciated%2C%3C%2FP%3E%3CP%3ECatherine%3C%2FP%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-3377034%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EFormulas%20and%20Functions%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3377105%22%20slang%3D%22en-US%22%3ERe%3A%20excel%20IF%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3377105%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1390826%22%20target%3D%22_blank%22%3E%40Catherine800%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI'd%20enter%20the%20thresholds%200%2C%2033%2C49.5%20etc.%20in%20a%20row%20above%20the%20cells%20where%20you%20want%20the%20results.%20In%20the%20screenshot%20below%2C%20they%20are%20in%20J6%3AN6.%20I%20also%20added%20a%20value%20larger%20than%20the%20deepest%20dive%20in%20O6.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22S1437.png%22%20style%3D%22width%3A%20686px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371750iE630EC408F5CD301%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22S1437.png%22%20alt%3D%22S1437.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20formula%20in%20J7%20is%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-excel-formula%22%3E%3CCODE%3E%3D(%24G7%26gt%3B%3DJ%246)*(%24G7%3CK%3E%3C%2FK%3E%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3EThis%20can%20be%20filled%20to%20the%20right%20to%20N7%2C%20then%20down.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3377123%22%20slang%3D%22en-US%22%3ERe%3A%20excel%20IF%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3377123%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F1390826%22%20target%3D%22_blank%22%3E%40Catherine800%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EPerhaps%20something%20like%20this.%26nbsp%3B%3C%2FP%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%22JMB17_0-1652643053439.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F371751i38AB3002D5DC7113%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22JMB17_0-1652643053439.png%22%20alt%3D%22JMB17_0-1652643053439.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EEdit%3A%20The%20%E2%88%9E%20symbol%20can%20be%20input%20by%20holding%20down%20the%20alt%20key%20and%20hitting%20236%20on%20the%20number%20keypad.%20Excel%20treats%20any%20text%20value%20as%20greater%20than%20any%20number.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-3377460%22%20slang%3D%22en-US%22%3ERe%3A%20excel%20IF%20formula%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-3377460%22%20slang%3D%22en-US%22%3EBrilliant%2C%20it%20works%20perfect!%20thank%20you%20so%20much%2C%20Catherine%3C%2FLINGO-BODY%3E
New Contributor

Hello,  I have a commercial dive school and am creating an excel spreadsheet to calculate dive minutes and allocate these minutes to specific columns which represent different dive depth.  

This is the statement I am trying to create in excel.

 

If the divers depth is between 0-33 feet then the depth recorded in  G7 cell is copied to j7.  If the depth is between 33-49.5 ft then G7 is copied to k7.  If the depth is between 49.5-66 ft then G7 is copied to l7.  IF the depth is between 66-98 ft then G7 is copied to M7.  And if the depth is to 99 ft then G7 is copied to N7.    Otherwise "0" is entered in each J7, K7, L7, M7, N7.

 

So for every dive one of the cells (J7, K7, L7, M7, N7)   will have the dive depth that was recorded on G7.

 

Much appreciated,

Catherine

 

 

3 Replies
best response confirmed by Sergei Baklan (MVP)
Solution

@Catherine800 

I'd enter the thresholds 0, 33,49.5 etc. in a row above the cells where you want the results. In the screenshot below, they are in J6:N6. I also added a value larger than the deepest dive in O6.

S1437.png

The formula in J7 is

=($G7>=J$6)*($G7<K$6)*$G7

This can be filled to the right to N7, then down.

@Catherine800 

 

Perhaps something like this. 

 

JMB17_0-1652643053439.png

 

Edit: The ∞ symbol can be input by holding down the alt key and hitting 236 on the number keypad. Excel treats any text value as greater than any number.

 

Brilliant, it works perfect! thank you so much, Catherine