Jump to content

Hey guys, I want the cell D44 to show "5%" if the value in G35 is between 999 and 1999 and to display "10% if G35 is 2000 or more. How could I do this? I just started IF statements. Can anyone help here? Thanks

 

Screenshot_4.png.c77528c3196591ec1046709e5c451c1f.png

Quote me so I can reply back :) 

MY PC-> PSU: EVGA SuperNOVA T2 1000W 80 Plus Titanium MOTHERBOARD: ASUS X370 Crosshair VI Hero CPU: RYZEN 7 3700X RAM: G.Skill 32GB (4X8GB) DDR4 3200MHz C14 GPU: EVGA GTX 1080Ti FTW3 HYBRID STORAGE: Samsung 970 EVO 500GB NVMe SSD; 2TB WD Caviar Blue; Crucial MX500 500GB SSD CUSTOM LOOP: EK-Velocity Nickel + Plexi CPU block, EK-FC1080 GTX Ti Acetal + Nickel GPU Block w/ EK-FC1080 GTX Ti Backplate, EK-XRES 140 Revo D5 PWM, EK-CoolStream PE 240 w/ 2x Noctua NF-F12 Chromax fans, EK-ACF Fitting 10/13mm Nickel, Mayhems UV White tubing 13/10mm, 3x Noctua NF-S12A Chromax case fans

Link to comment
https://linustechtips.com/topic/865119-excel/
Share on other sites

Link to post
Share on other sites

yes, in cell D44, put

Quote

=if(and(G35>999,G35<1999),"5%",if(G35>=2000,"10%",""))

Edit: I tested it and it works :P

 

However I should say though that your conditions are incomplete.  What happens if the value is under 999?  I have it set to be blank above.  What happens if the value is between 1999 and 2000?  Currently that also goes blank, and is not independently addressable.

Solve your own audio issues  |  First Steps with RPi 3  |  Humidity & Condensation  |  Sleep & Hibernation  |  Overclocking RAM  |  Making Backups  |  Displays  |  4K / 8K / 16K / etc.  |  Do I need 80+ Platinum?

If you can read this you're using the wrong theme.  You can change it at the bottom.

Link to comment
https://linustechtips.com/topic/865119-excel/#findComment-10746301
Share on other sites

Link to post
Share on other sites

32 minutes ago, Ryan_Vickers said:

yes, in cell D44, put

Edit: I tested it and it works :P

 

However I should say though that your conditions are incomplete.  What happens if the value is under 999?  I have it set to be blank above.  What happens if the value is between 1999 and 2000?  Currently that also goes blank, and is not independently addressable.

It does work mate, thanks a lot. It's for college, and we haven't been in depth on IF statements. The formula you provided helped me better understand more complex IF statements. I was around that for a quite a while before making a post. Thanks a lot, I was able to finish my excel sheet because of that. Also, I set it to be 0% if the value is under 999 :)

 

Quote me so I can reply back :) 

MY PC-> PSU: EVGA SuperNOVA T2 1000W 80 Plus Titanium MOTHERBOARD: ASUS X370 Crosshair VI Hero CPU: RYZEN 7 3700X RAM: G.Skill 32GB (4X8GB) DDR4 3200MHz C14 GPU: EVGA GTX 1080Ti FTW3 HYBRID STORAGE: Samsung 970 EVO 500GB NVMe SSD; 2TB WD Caviar Blue; Crucial MX500 500GB SSD CUSTOM LOOP: EK-Velocity Nickel + Plexi CPU block, EK-FC1080 GTX Ti Acetal + Nickel GPU Block w/ EK-FC1080 GTX Ti Backplate, EK-XRES 140 Revo D5 PWM, EK-CoolStream PE 240 w/ 2x Noctua NF-F12 Chromax fans, EK-ACF Fitting 10/13mm Nickel, Mayhems UV White tubing 13/10mm, 3x Noctua NF-S12A Chromax case fans

Link to comment
https://linustechtips.com/topic/865119-excel/#findComment-10746419
Share on other sites

Link to post
Share on other sites

Just now, bruny06 said:

It does work mate, thanks a lot. It's for college, and we haven't been in depth on IF statements. The formula you provided helped me better understand more complex IF statements. I was around that for a quite a while before making a post. Thanks a lot, I was able to finish my excel sheet because of that. :)

 

They're pretty basic, it's just IF(<condition>, <show this if it's true>, <show this if it's false>), and then of course you can nest additional things as needed.  Don't be afraid to check google for the definition/use of a function you come across, they're all well documented.  Glad I could help though :)

Solve your own audio issues  |  First Steps with RPi 3  |  Humidity & Condensation  |  Sleep & Hibernation  |  Overclocking RAM  |  Making Backups  |  Displays  |  4K / 8K / 16K / etc.  |  Do I need 80+ Platinum?

If you can read this you're using the wrong theme.  You can change it at the bottom.

Link to comment
https://linustechtips.com/topic/865119-excel/#findComment-10746428
Share on other sites

Link to post
Share on other sites

7 minutes ago, Ryan_Vickers said:

They're pretty basic, it's just IF(<condition>, <show this if it's true>, <show this if it's false>), and then of course you can nest additional things as needed.  Don't be afraid to check google for the definition/use of a function you come across, they're all well documented.  Glad I could help though :)

Yeah, they are, the thing is, I didn't know how to display "5%" if the value was between 0 and 999 as I didn't know how to put "between 0 and 999" in the formula, but I really didn't need to do that, as I could put two logical values in. This helped a lot, really, It may have been you doing the formula, but I truly understand it and could replicate it by myself, which was my goal.

Quote me so I can reply back :) 

MY PC-> PSU: EVGA SuperNOVA T2 1000W 80 Plus Titanium MOTHERBOARD: ASUS X370 Crosshair VI Hero CPU: RYZEN 7 3700X RAM: G.Skill 32GB (4X8GB) DDR4 3200MHz C14 GPU: EVGA GTX 1080Ti FTW3 HYBRID STORAGE: Samsung 970 EVO 500GB NVMe SSD; 2TB WD Caviar Blue; Crucial MX500 500GB SSD CUSTOM LOOP: EK-Velocity Nickel + Plexi CPU block, EK-FC1080 GTX Ti Acetal + Nickel GPU Block w/ EK-FC1080 GTX Ti Backplate, EK-XRES 140 Revo D5 PWM, EK-CoolStream PE 240 w/ 2x Noctua NF-F12 Chromax fans, EK-ACF Fitting 10/13mm Nickel, Mayhems UV White tubing 13/10mm, 3x Noctua NF-S12A Chromax case fans

Link to comment
https://linustechtips.com/topic/865119-excel/#findComment-10746480
Share on other sites

Link to post
Share on other sites

2 minutes ago, bruny06 said:

Yeah, they are, the thing is, I didn't know how to display "5%" if the value was between 0 and 999 as I didn't know how to put "between 0 and 999" in the formula, but I really didn't need to do that, as I could put two logical values in. This helped a lot, really, It may have been you doing the formula, but I truly understand it and could replicate it by myself, which was my goal.

Ah, yeah, if you have a slightly more complex condition, you can use AND, OR, etc. to combine multiple things as needed :)

 

Above was my attempt to answer exactly what you asked, but if I were to take a guess at what is really intended and design something for that, I might do it like this:

Quote

=IF(G35>=2000, "10%", if(G35>=1000, "5%", if(G35>=0, "0%", "N/A")))

 

Solve your own audio issues  |  First Steps with RPi 3  |  Humidity & Condensation  |  Sleep & Hibernation  |  Overclocking RAM  |  Making Backups  |  Displays  |  4K / 8K / 16K / etc.  |  Do I need 80+ Platinum?

If you can read this you're using the wrong theme.  You can change it at the bottom.

Link to comment
https://linustechtips.com/topic/865119-excel/#findComment-10746485
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×