Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Post History

42%
+1 −2
Q&A How to add to the value of one cell an amount that depends upon the range of a different cell?

A user of Web Applications asked how to: +1 when the value is >=5, +2 when the value is >=10, +3 when the value is >=15, +4 when the value is >=20, +5 when the value is >=25...

1 answer  ·  posted 4y ago by pnuts‭  ·  last activity 3y ago by Alexei‭

#5: Post undeleted by user avatar Alexei‭ · 2021-05-26T18:08:40Z (over 3 years ago)
#4: Post deleted by user avatar pnuts‭ · 2020-12-07T15:36:57Z (almost 4 years ago)
#3: Post edited by user avatar Alexei‭ · 2020-11-01T07:00:48Z (about 4 years ago)
replaced tags with more meaningful ones
#2: Post edited by user avatar pnuts‭ · 2020-10-04T01:10:36Z (about 4 years ago)
  • A user of Web Applications [asked](https://webapps.stackexchange.com/questions/135256/google-sheet-if-function-not-working) how to:
  • > - +1 when the value is >=5,
  • > - +2 when the value is >=10,
  • > - +3 when the value is >=15,
  • > - +4 when the value is >=20,
  • > - +5 when the value is >=25
  • and had tried:
  • =IF(F7>=5,H7+1,IF(F7>=10,H7+2,IF(F7>=15,H7+3,IF(F7>=20,H7+4,H7))))
  • in Google Sheets without success. The formula does however indicate that the 'value' resides in `F7` and supplementation is of the `H7` value.
  • A user of Web Applications [asked](https://webapps.stackexchange.com/questions/135256/google-sheet-if-function-not-working) how to:
  • > - +1 when the value is >=5,
  • > - +2 when the value is >=10,
  • > - +3 when the value is >=15,
  • > - +4 when the value is >=20,
  • > - +5 when the value is >=25
  • and had tried:
  • =IF(F7>=5,H7+1,IF(F7>=10,H7+2,IF(F7>=15,H7+3,IF(F7>=20,H7+4,H7))))
  • in Google Sheets without success. The formula does however indicate that the 'value' resides in `F7` and supplementation is of the `H7` value.
  • As explained by [an answer](https://webapps.stackexchange.com/a/135262) that retains the original concept of nested IFs:
  • <pre> =IF(
  • F7>=25,H7+5,
  • IF(
  • F7>=20,H7+4,
  • IF(
  • F7>=15,H7+3,
  • IF(
  • F7>=10,H7+2,
  • IF(F7>=5,H7+1,H7)
  • )
  • )
  • )
  • )</pre>
  • >If the first condition is F7>=5 then the result will always be +1 wether F7 = 5, 15, or even 200.
  • It's because the first condition F7>=5 is always met.
  • Stepping down the ranges does achieve the desired result but is there a shorter of more versatile solution, since nested IFs with ranges are often problematic?
#1: Initial revision by user avatar pnuts‭ · 2020-10-04T01:06:01Z (about 4 years ago)
How to add to the value of one cell an amount that depends upon the range of a different cell?
A user of Web Applications [asked](https://webapps.stackexchange.com/questions/135256/google-sheet-if-function-not-working) how to:

> - +1 when the value is >=5,   
> - +2 when the value is >=10,   
> - +3 when the value is >=15,   
> - +4 when the value is >=20,   
> - +5 when the value is >=25  

and had tried:

    =IF(F7>=5,H7+1,IF(F7>=10,H7+2,IF(F7>=15,H7+3,IF(F7>=20,H7+4,H7))))

in Google Sheets without success. The formula does however indicate that the 'value' resides in `F7` and supplementation is of the `H7` value.