• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 11:21
CET 17:21
KST 01:21
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Revival - 2025 Season Finals Preview7RSL Season 3 - Playoffs Preview0RSL Season 3 - RO16 Groups C & D Preview0RSL Season 3 - RO16 Groups A & B Preview2TL.net Map Contest #21: Winners12
Community News
Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump1Weekly Cups (Nov 24-30): MaxPax, Clem, herO win2BGE Stara Zagora 2026 announced15[BSL21] Ro.16 Group Stage (C->B->A->D)4Weekly Cups (Nov 17-23): Solar, MaxPax, Clem win3
StarCraft 2
General
RSL Revival - 2025 Season Finals Preview Weekly Cups (Dec 1-7): Clem doubles, Solar gets over the hump Chinese SC2 server to reopen; live all-star event in Hangzhou Maestros of the Game: Live Finals Preview (RO4) BGE Stara Zagora 2026 announced
Tourneys
RSL Offline Finals Info - Dec 13 and 14! Tenacious Turtle Tussle 2025 RSL Offline Finals Dates + Ticket Sales! Sparkling Tuna Cup - Weekly Open Tournament StarCraft2.fi 15th Anniversary Cup
Strategy
Custom Maps
Map Editor closed ?
External Content
Mutation # 503 Fowl Play Mutation # 502 Negative Reinforcement Mutation # 501 Price of Progress Mutation # 500 Fright night
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ [BSL21] RO8 Bracket & Prediction Contest BW General Discussion FlaSh on: Biggest Problem With SnOw's Playstyle Let's talk about Metropolis
Tourneys
[ASL20] Grand Finals [BSL21] RO8 - Day 2 - Sunday 21:00 CET [BSL21] RO8 - Day 1 - Saturday 21:00 CET Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers Game Theory for Starcraft Fighting Spirit mining rates Current Meta
Other Games
General Games
Dawn of War IV Path of Exile Stormgate/Frost Giant Megathread Awesome Games Done Quick 2026! Nintendo Switch Thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Mafia Game Mode Feedback/Ideas Survivor II: The Amazon Sengoku Mafia TL Mafia Community Thread
Community
General
Russo-Ukrainian War Thread Things Aren’t Peaceful in Palestine US Politics Mega-thread YouTube Thread European Politico-economics QA Mega-thread
Fan Clubs
White-Ra Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece Movie Discussion!
Sports
2024 - 2026 Football Thread Formula 1 Discussion
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
TL+ Announced Where to ask questions and add stream?
Blogs
How Sleep Deprivation Affect…
TrAiDoS
I decided to write a webnov…
DjKniteX
James Bond movies ranking - pa…
Topin
Thanks for the RSL
Hildegard
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1449 users

How to evaluate a piecewise function with Excel?

Forum Index > General Forum
Post a Reply
Betalump
Profile Blog Joined September 2010
United States109 Posts
Last Edited: 2011-05-06 11:26:54
May 06 2011 11:25 GMT
#1
I fully understand that Excel is not the best program to do this type of work. However it is the medium I have available and I would like to use Excel so that I can tie it into a bunch of work that I've already done with it.

The goal is to get Excel to successfully plot a curve of a piecewise function that looks something like this.

If X=0 y=240
If X=1-2 y=240+45(X-0)
If X=3-10 y=240+90+39(X-2)
If X=11-14 y=240+90+232+24(X-10)
If X=15-18 y=240+90+232+96+12(X-14)
etc etc

Then I need to be able to integrate piecewise or be able to get it to calculate the total area under the curve up until any value of X.

If possible, I would like to be able to substitute a different series of equations and different limits of X for each equation to quickly generate a different curve.

Thanks!
Caller
Profile Blog Joined September 2007
Poland8075 Posts
May 06 2011 11:32 GMT
#2
if there's no pattern in your x's you're going to have to manually input it in brah
Watch me fail at Paradox: http://www.teamliquid.net/forum/viewmessage.php?topic_id=397564
Aim Here
Profile Blog Joined December 2009
Scotland672 Posts
Last Edited: 2011-05-06 11:42:14
May 06 2011 11:41 GMT
#3
This is more of a blog, but anyways, there's two ways to get a cell with the values of your function.

If your function is easy, use nested IFs, as in a formula with
=IF(x=<1,240,IF(x<2,240+45*(x),IF ... )))

Or you could put the bounding values of the piecewise chunks of X in as a column in a table and the Y formulae in the second column, and use vlookup to look them up.

Once you can put the values in a cell, then you can knock up a table with a list of X values, and the formulae values, and then turn it into a graph.

If you need more clarification, you can PM me.
Starfox
Profile Joined April 2010
Austria699 Posts
May 06 2011 12:17 GMT
#4
On May 06 2011 20:25 Betalump wrote:
I fully understand that Excel is not the best program to do this type of work. However it is the medium I have available and I would like to use Excel so that I can tie it into a bunch of work that I've already done with it.

The goal is to get Excel to successfully plot a curve of a piecewise function that looks something like this.

If X=0 y=240
If X=1-2 y=240+45(X-0)
If X=3-10 y=240+90+39(X-2)
If X=11-14 y=240+90+232+24(X-10)
If X=15-18 y=240+90+232+96+12(X-14)
etc etc

Then I need to be able to integrate piecewise or be able to get it to calculate the total area under the curve up until any value of X.

If possible, I would like to be able to substitute a different series of equations and different limits of X for each equation to quickly generate a different curve.

Thanks!

Do something like
https://spreadsheets.google.com/ccc?key=0AsHwOnuKF-uIdHJqd1RGOHB6LWlFZXYzc2c2UXJJVmc&hl=en&authkey=CL6hiJgI
Then you would go about and do a SCATTER plot across the X and Y cells, there should be an option to connect the dots of the scatter plot. You can then change the X values and the how it increases at each part.
Greek Mythology 2.0: Imagine Sisyphos as a man who wants to watch all videos on youtube... and Tityos as one who HAS to watch all of them.
Glacierz
Profile Blog Joined May 2010
United States1245 Posts
May 06 2011 15:59 GMT
#5
On May 06 2011 20:41 Aim Here wrote:
This is more of a blog, but anyways, there's two ways to get a cell with the values of your function.

If your function is easy, use nested IFs, as in a formula with
=IF(x=<1,240,IF(x<2,240+45*(x),IF ... )))

Or you could put the bounding values of the piecewise chunks of X in as a column in a table and the Y formulae in the second column, and use vlookup to look them up.

Once you can put the values in a cell, then you can knock up a table with a list of X values, and the formulae values, and then turn it into a graph.

If you need more clarification, you can PM me.


Are you proficient in VBA? If so try to use the switch function on x, otherwise use the above post's nested IF statements.
Please log in or register to reply.
Live Events Refresh
WardiTV 2025
13:00
Seeding Matches
SHIN vs herO
Clem vs herO
Clem vs ShoWTimELIVE!
WardiTV1543
ComeBackTV 1085
TaKeTV 408
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
BRAT_OK 65
MindelVK 47
Railgan 38
DivinesiaTV 20
StarCraft: Brood War
Britney 31933
Calm 3227
Bisu 1241
Jaedong 789
Horang2 759
Stork 538
Hyuk 421
actioN 180
Last 165
EffOrt 157
[ Show more ]
Hyun 117
Sharp 103
Zeus 91
Killer 53
Mong 44
Aegong 40
scan(afreeca) 36
zelot 32
Movie 25
ajuk12(nOOB) 14
Noble 9
Dota 2
Gorgc6052
singsing4295
qojqva2468
syndereN368
XcaliburYe188
LuMiX1
Counter-Strike
fl0m3428
allub235
oskar104
Heroes of the Storm
Khaldor557
Liquid`Hasu371
Other Games
FrodaN2992
B2W.Neo995
Beastyqt752
Mlord597
ceh9593
Fuzer 205
KnowMe111
XaKoH 92
ArmadaUGS68
Mew2King38
OptimusSC22
Organizations
Other Games
EGCTV1361
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• HeavenSC 21
• poizon28 20
• Adnapsc2 19
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Nemesis3112
Other Games
• Scarra1275
Upcoming Events
IPSL
3h 40m
Sziky vs JDConan
BSL 21
3h 40m
Tech vs Cross
Bonyth vs eOnzErG
Replay Cast
16h 40m
Wardi Open
19h 40m
Monday Night Weeklies
1d
Sparkling Tuna Cup
1d 17h
Replay Cast
3 days
The PondCast
3 days
CranKy Ducklings
5 days
SC Evo League
5 days
[ Show More ]
BSL 21
6 days
Sparkling Tuna Cup
6 days
Liquipedia Results

Completed

Acropolis #4 - TS3
RSL Revival: Season 3
Kuram Kup

Ongoing

C-Race Season 1
IPSL Winter 2025-26
KCM Race Survival 2025 Season 4
YSL S2
BSL Season 21
Slon Tour Season 2
WardiTV 2025
META Madness #9
SL Budapest Major 2025
ESL Impact League Season 8
BLAST Rivals Fall 2025
IEM Chengdu 2025
PGL Masters Bucharest 2025
Thunderpick World Champ.
CS Asia Championships 2025
ESL Pro League S22

Upcoming

CSL 2025 WINTER (S19)
BSL 21 Non-Korean Championship
Acropolis #4
IPSL Spring 2026
Bellum Gens Elite Stara Zagora 2026
HSC XXVIII
Big Gabe Cup #3
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.